I have created a Simple React App and succeed because it already showed the happy hacking message on cmd, however when i type and ran "npm start" on cmd it gives a lot of errors. I've tried to uninstall then install the node and npm several times but it still doesn't work. here's the error message
Creating a new React app in C:\myapp2.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
> core-js#2.6.10 postinstall C:\myapp2\node_modules\babel-runtime\node_modules\core-js
> node postinstall || echo "ignore"
> core-js#3.2.1 postinstall C:\myapp2\node_modules\core-js
> node scripts/postinstall || echo "ignore"
+ react-dom#16.11.0
+ react#16.11.0
+ react-scripts#3.2.0
added 1475 packages from 693 contributors and audited 904933 packages in 828.526s
found 0 vulnerabilities
Success! Created myapp2 at C:\myapp2
Starting the development server...
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:3000/' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myapp2#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myapp2#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2019-11-13T21_57_29_371Z-debug.log
I hope you guys can help me to point out where i should make changes so it can work successfully. thanks in advance !
after creating a project with create-react-app
create-react-app name
you have to go inside the created folder
cd name
and then run
npm start
again
first create a folder in one Drive( D: or E:),open it in command prompt and create a react app like:
npm create-react-app project name
or
npx-create-react-app project name
cd project name
npm start
Related
I am trying to run my project on Linux Mint that I just installed and configured but when I run the npm run dev command. "spawn node_modules / webpack / bin / webpack.js EACCES" error appears.
I have tried all the methods provided on the internet such as reinstalling nodes, upgrading versions, clear cache nodes and deleting folders. but still error.
> # dev /home/wirnat/Web/Bukasewa/bukasewa.vBETA
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn node_modules/webpack/bin/webpack.js EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'EACCES',
code: 'EACCES',
syscall: 'spawn node_modules/webpack/bin/webpack.js',
path: 'node_modules/webpack/bin/webpack.js',
spawnargs: [
'--progress',
'--hide-modules',
'--config=node_modules/laravel-mix/setup/webpack.config.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # dev: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/wirnat/.npm/_logs/2019-10-17T12_37_01_854Z-debug.log
"maybe this problem has to do with permission, but I'm just learning linux and don't really understand it."
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
I just followed above steps and it worked.
I faced the same problem today. Here is my solution
Check your permissions if the node_modules folder is executable by running ls -la (760 is recomended). If thing seems to be okay then try deleting the node_modules folder and install all the modules again by running npm install then run the command npm run development or production depending on your deployment environment
When I try to create a new Angular 4 project with 'ng new myProject', the project folder, sub folders and files are created,
but I also always get these errors:
npm ERR! path c:\projects\hello-world\node_modules\fsevents\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rmdir
npm ERR! Error: EPERM: operation not permitted, rmdir 'c:\projects\hello-world\node_modules\fsevents\node_modules'
npm ERR! { Error: EPERM: operation not permitted, rmdir 'c:\projects\hello-world\node_modules\fsevents\node_modules'
npm ERR! stack: 'Error: EPERM: operation not permitted, rmdir \'c:\\projects\\hello-world\\node_modules\\fsevents\\node_modules\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rmdir',
npm ERR! path: 'c:\\projects\\hello-world\\node_modules\\fsevents\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
I open the Node.js command prompt as Administrator when I issue the ng new command.
I am using Win7 Pro. I have install the following successfully and without any errors. The ng -v returns the following:
-Angular CLI: 1.5.0
-Node: 8.9.0
-OS: win32 x64
-Angular:
npm -v returns: 5.5.1
I give my user account, based on the 'whoami' results, full admin permissions to the myProject folder, the C:\Users\myAccount\AppData\Roaming\npm folder and %APPDATA%\npm-cache folder.
I also perform a 'npm cache verify'.
But I still get the above errors on the ng new command.
How do I correct these errors? Or can I ignore these errors?
If you still run into this problem, one reason you might be running into this is that you installed your CLI tools (#angular/cli) using either 'sudo npm install -g #angular/cli' or as root, from the 'sudo su - root' command, then simply 'npm install -g #angular/cli', and your problem seems to arise whenever you're not logged in and calling an 'ng' command as root or with 'sudo'. This makes sense, but it always causes some kind of insufficient permission related error; and it's not even your fault.
You can easily try to fix or mitigate this serious error by creating and saving a dot-file named '.npm-global' in your home directory ('~/'), then running the command, npm config set prefix '~/.npm-global'.
Then, simply include the line in either /etc/profile or ~/.profile, export PATH=~/.npm-global/bin:$PATH, and run 'source /etc/profile' or 'source ~/.profile' to finalize it. [1]
After that, simply remove anything Node, like 'node_modules/', 'package-lock.json', just all of it.... Then, try installing your NPM packages again -- this time, without using 'sudo' and without root signed in.
https://docs.npmjs.com/getting-started/fixing-npm-permissions
I am trying to build https://github.com/Microsoft/vscode from the source, but I am not sure exactly what to do. When I ran scripts\npm.bat install, it completed successfully. Then I ran scripts\code.bat and a stranger window showed up. It is it the compiled version? It did not seem to work correctly.
How can I create full build? The page:
https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source
Does not offered how to create an executable from the source. When I run scripts\npm.bat install what should happen? For now I only see it create the folder out/out-build within some javascript files, as showed bellow. What are those files and what I do with them?
Later I tried to ran the scripts\code.bat and created an executable similar in size to the stable version on the folder .build\electron:
But when I ran npm run watch, this error is throw:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! code-oss-dev#1.15.0 watch: `gulp watch --max_old_space_size=4096`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the code-oss-dev#1.15.0 watch script 'gulp watch --max_old_space_size=4096'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the code-oss-dev package,
npm ERR! not with npm itself.
I found the other question:
How to build release vscode version
But I could not figure it out correctly how to build it. Forehand I figured out the following steps to setup the environment:
Install NodeJS and npm. See
the tutorial How to Install Node.js® and NPM on
Windows
Run this command npm install --global --production windows-build-tools from cmd line as
Administrator. See npm install error - MSB3428: Could not load the Visual C++ component
“VCBuild.exe”
Install gulp. See gulpjs/gulp#Getting
Started
Steps to Reproduce
git clone https://github.com/Microsoft/vscode
cd vscode
scripts\npm.bat install
npm run watch
Outputs: F:\vscode>npm run watch
File npm-debug.log:
1) When I ran the command scripts\npm.bat install for the first time, this was the output:
F:\vscode>scripts\npm.bat install
2) When I ran the command scripts\npm.bat install for the after the first time, this was the output:
F:\vscode>scripts\npm.bat install
3) When I ran the command scripts\code.bat, this was the output:
F:\vscode>scripts\code.bat
And the following window showed up:
4) When I ran the command npm owner ls code-oss-dev as asked by the npm run watch error message, this was the output:
F:\vscode>npm owner ls code-oss-dev
npm ERR! owner ls Couldn't get owner data code-oss-dev
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "owner" "ls" "code-oss-dev"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/code-oss-dev
npm ERR! 404
npm ERR! 404 'code-oss-dev' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! F:\vscode\npm-debug.log
F:\vscode>
5) When I ran the command npm bugs code-oss-dev as asked by the npm run watch error message, this was the error output:
F:\vscode>npm bugs code-oss-dev
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "bugs" "code-oss-dev"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/code-oss-dev
npm ERR! 404
npm ERR! 404 'code-oss-dev' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! F:\vscode\npm-debug.log
F:\vscode>
6) I also ran the command gulp, this was the output:
F:\vscode>gulp
7) When I ran the command gulp compile-client-build, this was the output:
F:\vscode>gulp compile-client-build
[08:36:37] Using gulpfile F:\vscode\gulpfile.js
[08:36:37] Starting 'clean-client-build'...
[08:36:37] Finished 'clean-client-build' after 49 ms
[08:36:37] Starting 'compile-client-build'...
[08:36:38] Starting compilation...
[08:50:08] [monaco.d.ts] Starting monaco.d.ts generation
[08:50:12] [monaco.d.ts] Finished monaco.d.ts generation
[08:50:12] Finished compilation with 0 errors after 814540 ms
[08:50:12] Finished 'compile-client-build' after 14 min
8) When I ran the command gulp vscode-win32-ia32, this was the error output:
[02:15:28] Starting 'vscode-win32-ia32'...
internal/streams/legacy.js:59
throw er; // Unhandled stream error in pipe.
^
Error: read ECONNRESET
at exports._errnoException (util.js:1018:11)
at TLSWrap.onread (net.js:568:26)
F:\vscode>gulp vscode-win32-ia32
9) When I ran the command gulp vscode-win32-x64, this was the error output:
[03:02:59] Starting 'vscode-win32-x64'...
internal/streams/legacy.js:59
throw er; // Unhandled stream error in pipe.
^
Error: read ECONNRESET
at exports._errnoException (util.js:1018:11)
at TLSWrap.onread (net.js:568:26)
F:\vscode>gulp vscode-win32-x64
10) When I ran the command npm run gulp -- vscode-win32-ia32, this was the error output:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "run" "gulp" "--" "vscode-win32-ia32"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! code-oss-dev#1.15.0 gulp: `gulp --max_old_space_size=4096 "vscode-win32-ia32"`
npm ERR! Exit status 3
F:\vscode>npm run gulp -- vscode-win32-ia32
File npm-debug.log for the command npm run gulp -- vscode-win32-ia32 just above.
11) When I ran the command gulp watch --max-old-space-size=4096, this was the output, and the program hanged on this line:
F:\vscode>gulp watch --max-old-space-size=4096
npm version
F:\vscode>npm --version
3.10.10
F:\vscode>node --version
v6.11.0
F:\vscode>ver
Microsoft Windows [Version 10.0.15063]
F:\vscode>python --version
Python 2.7.13 :: Continuum Analytics, Inc.
VSCode Version: code-oss-dev#1.15.0
OS Version: Windows 10 build 15063 x64
Originally posted on: Failed at the code-oss-dev#1.15.0 watch script 'gulp watch --max_old_space_size=4096'
Related issues:
Development Environment Improvements (code.bat/code.sh)
Errors Compiling from Source on Arch Linux
Unable to setup vscode locally
Debug Batch (.bat) files
"JavaScript heap out of memory" when building on RHEL-7
Failed at the electron-mksnapshot#1.6.0 install script
Unhandled stream error in pipe
stream.js:74 throw er; // Unhandled stream error in pipe.
Node.js – events js 72 throw er unhandled 'error' event
vscode-win32-ia32 build failure: JavaScript heap out of memory
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
npm/npm#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
nodejs/node#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
The problem seems to be the outdated version 6.11.0 of nodejs used. From the issue: Failed at the code-oss-dev#1.15.0 watch script 'gulp watch --max_old_space_size=4096' on the VSCode issue tracker, we may follow the steps:
Install Node 7.9.0
git clean -xfd .
git pull
.\scripts\npm.bat install
Then, if there are no errors:
npm run watch
Run it until it tells you compilation succeeded. Then:
.\scripts\code.bat
When I try to follow the instructions, I get:
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:310:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\code\vscode\node_modules\native-watchdog
Not sure why, but it seems as if node-gyp cannot find visual studio.
I am getting the below error when i clone the angular seed from github and run the node server. I have cloned the angular seed to the existing project directory. I am not sure what is going wrong. But i am getting the below error. Kindly help
$ npm start
> StickyTodos#0.0.0 prestart C:\projects\StickyTodos
> npm install
> StickyTodos#0.0.0 postinstall C:\projects\StickyTodos
> bower install
> StickyTodos#0.0.0 start C:\projects\StickyTodos
> http-server -a localhost -p 8000 -c-1
events.js:141
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8000
at Object.exports._errnoException (util.js:860:11)
at exports._exceptionWithHostPort (util.js:883:20)
at Server._listen2 (net.js:1234:14)
at listen (net.js:1270:10)
at net.js:1379:9
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:63:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:82:10)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v5.0.0
npm ERR! npm v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! StickyTodos#0.0.0 start: `http-server -a localhost -p 8000 -c-1`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the StickyTodos#0.0.0 start script 'http-server -a localhost -p 8000 -c-1'.
npm ERR! This is most likely a problem with the StickyTodos package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server -a localhost -p 8000 -c-1
npm ERR! You can get their info via:
npm ERR! npm owner ls StickyTodos
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\projects\StickyTodos\npm-debug.log
The error Error: listen EADDRINUSE 127.0.0.1:8000 is explaining that something is already bound to port 8000.
As you are on Windows, running netstat -a -b in an elevated command prompt (Right click start button and press Command Prompt (Admin)) should show you what is already listening to port 8000.
Simply stop that process, or alternatively bind to a different port which is free.
I recently switched to Ubuntu 14.04, and also worked on my Mac machine. This project is cloned from the same repo, but behaves differently on two machines. I have no clue why, please help me.
I used this line to hashed my password, and it works fine on my mac machine.
var hashed = crypto.pbkdf2Sync(entered,this.salt,12000,128).toString('hex');
However, in Ubuntu, it gives following errors:
> node ./bin/www
crypto.js:574
var ret = binding.PBKDF2(password, salt, iterations, keylen, digest);
^
TypeError: Not a buffer
at TypeError (native)
at pbkdf2 (crypto.js:574:23)
at Object.exports.pbkdf2Sync (crypto.js:553:10)
at model.<anonymous> (/media/linux/app/dataModel/userModel.js:30:33)
at _next (/media/linux/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:62:30)
at fnWrapper (/media/linux/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:186:18)
at model.Object.defineProperty.value.fn (/media/linux/app/node_modules/mongoose/lib/schema.js:215:9)
at _next (/media/linux/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:62:30)
at fnWrapper (/media/linux/app/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:186:18)
at /media/linux/app/node_modules/mongoose/lib/schema.js:198:13
at complete (/media/linux/app/node_modules/mongoose/lib/document.js:1107:5)
at /media/linux/app/node_modules/mongoose/lib/document.js:1133:20
at ObjectId.SchemaType.doValidate (/media/linux/app/node_modules/mongoose/lib/schematype.js:645:22)
at /media/linux/app/node_modules/mongoose/lib/document.js:1129:9
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)
npm ERR! Linux 3.19.0-25-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE
npm ERR! app#0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app#0.0.0 start script 'node ./bin/www'.
npm ERR! This is most likely a problem with the bocerapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /media/linux/app/npm-debug.log
Thanks in advance!