- Error while running npm run dev command in react application
- 2 Answers 2
- Не запускается локальный сервер
- Почему сборка React не запускается в браузере?
- 5 ответов
- npm run dev does nothing, leaves no output or debug log in windows 10 #129
- Comments
- RavibabuK commented Nov 9, 2017
- I’m submitting a .
- Your environment:
- Metnew commented Nov 9, 2017
- RavibabuK commented Nov 10, 2017
- Metnew commented Nov 10, 2017
- RavibabuK commented Nov 10, 2017 •
- Metnew commented Nov 10, 2017 •
- RavibabuK commented Nov 10, 2017 •
- npm run dev & npm run build problem #21
- Comments
- masonlin commented Nov 7, 2015
- $npm run dev
- $npm run build
Error while running npm run dev command in react application
I am new to React.js and i am trying to setup simple react application locally using webpack. while running the npm run dev command i m getting below error.
Error getting in command prompt after running npm run dev
Below is code in package.json file
Below is code for the webpack.config.js file
Code in app.js file
Here my .babelrc file
I have already install latest version of node.js
Thanks in Advance
2 Answers 2
You have to specify devtool, either by using -d devtools or by putting
in your webpack.config.js .
If you chose to change the webpack.config.js file you don’t need the -d option, if you use -d you must specify an argument after or it will throw an error.
As the error message says, you’re missing a value for the -d (—devtool) argument. You can find a list of valid values on this list. You can add this directly to your webpack config as follows:
You only need to have a value for devtool in the config if you want to use a value, similarly you only need to use the -d argument in the CLI if you are going to pass a value through the CLI. If you don’t want to use a devtool, remove it from your webpack config and change your dev script to webpack -w . However, for development, you’ll likely want sourcemaps, so I’d recommend using devtool: ‘source-map’ (you’ll still want to change your dev script to webpack -w ).
Источник
Не запускается локальный сервер
Прохожу книгу React in Action, скачал репозиторий автора з 4 главы? вставил в корне диска C
«https://github.com/react-in-action/letters-social/tree/chapter-4»
пробую запустить его с консоли в браузере ввожу команду npm run dev и получаю ошибку!!
Помощь в написании контрольных, курсовых и дипломных работ здесь.
локальный сервер
здравствуйте,вот я сделал локальный сервер раздаваемая через wifi как мне сделать чтобы при.
Локальный COM сервер
У меня получилось использовать библиотеку классов написанную на C# через COM. Сейчас задача стоит.
Локальный сервер
настроил свой сервер , проверил , все работает , но люди которые в моей локальной сети состоят.
Локальный сервер
Поставил xampp. Возникают ошибки при обработке любого PHP файла, даже если он пуст (только » 20
Ну вот ввел я npm install вылезла тонна ошибок на 2 страницы :Р
Но в итоге папка node_modules появилась)
Затем ввел npm run dev и снова ошибок на 2 страницы
Если верить автору то после команды npm run dev я могу зайти на http://localhost:3000/ и посмотреть на проект, но он не запустился
почему то
автор вот пишет что должно заработать после dev
With that, you can run the development command (npm run dev) and your app
should at least boot up and be available in the browser. If you haven’t already, make sure
you run npm run db:seed at least once to generate sample data for your database.
Running npm run dev will do a few things for you:
Start up the Webpack build process and development server
Start the JSON*server API so you can respond to network requests
Create a development server (useful for server*side rendering in chapter 12)
Hot*reload your app when changes occur (so you don’t have to refresh the app every
time you save a file)
Notify you of build errors (these should show up in the command line and the
browser if and when they occur)
When the app is up and running in development mode, you should be able to view the
running app at http://localhost:3000.
Ошибка на предпоследнем скрине у меня иногда тоже выскакивала. Для этого нужна удалить папку node_modules и затем заново установить все пакеты.
Добавлено через 1 минуту
У вас на последнем скрине выбило ошибку. Сделайте скрин, чтобы можно было видеть, какие действия делали до появления ошибки.
Источник
Почему сборка React не запускается в браузере?
Я пытаюсь создать свое приложение реакции, используя инструмент сборки реаги. Когда я пытаюсь «npm start», приложение работает нормально.
На http: // localhost: 3000 => я могу получить доступ к приложению.
Но когда я собираю приложение и пытаюсь получить доступ к файлу «index.html» в папке сборки, оно не работает, и я сталкиваюсь с белым пустым экраном.
Это папка сборки, которая была создана после запуска npm run build.
И это index.html
Я делаю что-то неправильно? Не могу ли я получить доступ к встроенному файлу index.html на моем веб-сервере apache?
5 ответов
Возможно, вы еще не заметили, но я не думаю, что ваш HTML-файл может правильно импортировать CSS и файлы сценариев. Когда я смотрю на вашу файловую структуру, я вижу, что все о сборке находится в папке сборки. Но в вашем html-файле есть косые черты («/») перед путями к файлам. Вот почему браузер ищет эти файлы под родительским элементом «сборки». Попробуйте удалить косые черты.
Вышеупомянутая проблема может быть преодолена, если вы добавите — «homepage»: «.»,
В вашем package.json. Это не официальный, но хороший взлом для подражания.
Чтобы решить эту проблему, перейдите в папку build , затем вы увидите файл manifest.json , откройте его и увидите, что у вас manifest.json есть:
Измените это на
Есть альтернативный способ решения проблемы:
Перед сборкой реагирующего проекта перейдите в файл package.json и укажите свойство homepage со значением . или, возможно, с базовым URL вашего сайта, см. пример:
Вам следует попробовать использовать пакет обслуживания здесь для запуска одностраничного приложения.
- npm install -g serve для глобальной установки
- serve help чтобы увидеть тексты помощи
- serve —single build для обслуживания одностраничного приложения. I сервер будет запущен, с которого вы можете получить доступ к вашему приложению реакции
Вам необходимо установить плагин / расширение для локального сервера.
Если вы являетесь пользователем vscode, найдите расширение сервера и установите его. Тогда в нижней части вашего редактора появится опция «Перейти к жизни».
Для другого пользователя редактора (atom / sublime) ищите плагины сервера.
Источник
npm run dev does nothing, leaves no output or debug log in windows 10 #129
Comments
RavibabuK commented Nov 9, 2017
I’m submitting a .
First of all, Thanks for the wonderful framework for React which is helpful for people who is trying to start the project like me.
I am not getting any output after run the command «npm run dev».
- I have clone the project to local space and installed dependencies by running ‘npm install’
- Then i run ‘npm run dev’ command to startup development server, but it does nothing. I am not seeing any error/warnings
- Please advice as i am new to work on this.
- Node version: 6.11.5
- Browser:
- OS: Windows 10
- Language/Platform/etc:
Your environment:
The text was updated successfully, but these errors were encountered:
Metnew commented Nov 9, 2017
Hi @RavibabuK , thanks for your interest, but I didn’t test it on Windows 🙁
Try to run it under git bash for Win, maybe it could resolve problem
RavibabuK commented Nov 10, 2017
Hi @Metnew , not working with git bash too. I am not receiving any output like above screenshot.
Metnew commented Nov 10, 2017
@RavibabuK Could you try to run the latest release(may fix this issue) and update node to 8 or 9 ?
RavibabuK commented Nov 10, 2017 •
I’ve tried with node 8.9.1 and latest release of suicrux, however i’m facing the same issue. I’ve changed dev script in package.json from «NODE_ENV=development babel-node ./src/server/index.dev» to «SET NODE_ENV=development babel-node ./src/server/index.dev.js» as i’m running this script in windows. Am i executing right script?
I’ve tried node 9 too, but npm version 5.5.1 is not supporting node 9 in windows 10.
Metnew commented Nov 10, 2017 •
I’ve just added cross-env , it may fix your issue
RavibabuK commented Nov 10, 2017 •
Yes, now i can see the below error atleast with cross-env fix. However i can’t run the app successfully.
Источник
npm run dev & npm run build problem #21
Comments
masonlin commented Nov 7, 2015
I suffer some problems, when I step in $npm run dev or $npm run build,
the console reply the below log:
$npm run dev
0 info it worked if it ends with ok
1 verbose cli [ ‘C:\Program Files\nodejs\node.exe’,
1 verbose cli ‘C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘run’,
1 verbose cli ‘dev’ ]
2 info using npm@2.14.3
3 info using node@v4.1.0
4 verbose run-script [ ‘predev’, ‘dev’, ‘postdev’ ]
5 info predev React-redux-socketio-chat@0.3.0
6 info dev React-redux-socketio-chat@0.3.0
7 verbose unsafe-perm in lifecycle true
8 info React-redux-socketio-chat@0.3.0 Failed to exec dev script
9 verbose stack Error: React-redux-socketio-chat@0.3.0 dev: NODE_ENV=development node devServer
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:817:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid React-redux-socketio-chat@0.3.0
11 verbose cwd D:\Git\repositories\react-redux-socketio-chat-master
12 error Windows_NT 10.0.10240
13 error argv «C:\Program Files\nodejs\node.exe» «C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js» «run» «dev»
14 error node v4.1.0
15 error npm v2.14.3
16 error code ELIFECYCLE
17 error React-redux-socketio-chat@0.3.0 dev: NODE_ENV=development node devServer
17 error Exit status 1
18 error Failed at the React-redux-socketio-chat@0.3.0 dev script ‘NODE_ENV=development node devServer’.
18 error This is most likely a problem with the React-redux-socketio-chat package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error NODE_ENV=development node devServer
18 error You can get their info via:
18 error npm owner ls React-redux-socketio-chat
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
$npm run build
0 info it worked if it ends with ok
1 verbose cli [ ‘C:\Program Files\nodejs\node.exe’,
1 verbose cli ‘C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘run’,
1 verbose cli ‘build’ ]
2 info using npm@2.14.3
3 info using node@v4.1.0
4 verbose run-script [ ‘prebuild’, ‘build’, ‘postbuild’ ]
5 info prebuild React-redux-socketio-chat@0.3.0
6 info build React-redux-socketio-chat@0.3.0
7 verbose unsafe-perm in lifecycle true
8 info React-redux-socketio-chat@0.3.0 Failed to exec build script
9 verbose stack Error: React-redux-socketio-chat@0.3.0 build: npm run clean && npm run build:webpack
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:817:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid React-redux-socketio-chat@0.3.0
11 verbose cwd D:\Git\repositories\react-redux-socketio-chat-master
12 error Windows_NT 10.0.10240
13 error argv «C:\Program Files\nodejs\node.exe» «C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js» «run» «build»
14 error node v4.1.0
15 error npm v2.14.3
16 error code ELIFECYCLE
17 error React-redux-socketio-chat@0.3.0 build: npm run clean && npm run build:webpack
17 error Exit status 1
18 error Failed at the React-redux-socketio-chat@0.3.0 build script ‘npm run clean && npm run build:webpack’.
18 error This is most likely a problem with the React-redux-socketio-chat package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error npm run clean && npm run build:webpack
18 error You can get their info via:
18 error npm owner ls React-redux-socketio-chat
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
Could you please give me some suggestion?
Thank you very much.
The text was updated successfully, but these errors were encountered:
Источник