Error in "npm start" command of angular seed cloning - javascript

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.

Related

Why I cannot run npm run dev on a centos7?

I have a problem installing my app on a new server, I come from centos6 to centos7.
When I am installing a Laravel app that works perfectly on centos6 it goes right except when I run npm run dev
[root#v6-a10 worknow4.0]# npm run dev
> dev
> npm run development
> development
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
node:events:306
throw er; // Unhandled 'error' event
^
Error: spawn node_modules/webpack/bin/webpack.js EACCES
at Process.ChildProcess._handle.onexit (node:internal/child_process:269:19)
at onErrorNT (node:internal/child_process:467:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:275:12)
at onErrorNT (node:internal/child_process:467:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
errno: -13,
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 1
npm ERR! path /home/admin/domains/worknow-cursos.com/public_html/worknow4.0
npm ERR! command failed
npm ERR! command sh -c cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-07T19_56_43_919Z-debug.log
npm ERR! code 1
npm ERR! path /home/admin/domains/worknow-cursos.com/public_html/worknow4.0
npm ERR! command failed
npm ERR! command sh -c npm run development
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-07T19_56_44_006Z-debug.log
I have been searching for an answer for hours but nothing works.
I tried to delete node_modules and package-lock and reinstall, but also didn't work.
Ok the problem might be permission as dimitri says. I just go to node_modules/webpack/bin/webpack.js and change the permission to 777
I dont know if this is recomended but at least works

Can not import reactjs

I'm trying to import react, I wrote the following code:
import React from "react";
but when I write npm start in the terminal it shows me these errors:
> reactjs-basics#1.0.0 start /home/zx-coder/Downloads/reactjs-basics-master
> npm run build
> reactjs-basics#1.0.0 build /home/zx-coder/Downloads/reactjs-basics-master
> webpack -d && cp src/index.html dist/index.html && webpack-dev-server --content-base src/ --inline --hot
Hash: 2692c371e3a85309b95e Version: webpack 1.15.0 Time: 1020ms
Asset Size Chunks Chunk Names
bundle.js 166 kB 0 [emitted] main bundle.js.map 184 kB 0 [emitted] main
+ 37 hidden modules events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8080
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1367:14)
at listenInCluster (net.js:1408:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1517:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
npm ERR! Linux 4.15.0-29-generic npm ERR! argv "/usr/bin/node"
"/usr/bin/npm" "run" "build" npm ERR! node v8.10.0 npm ERR! npm
v3.5.2 npm ERR! code ELIFECYCLE npm ERR! reactjs-basics#1.0.0 build:
`webpack -d &&cp src/index.html dist/index.html && webpack-dev-server
--content-base src/ --inline --hot` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the reactjs-basics#1.0.0 build script 'webpack -d
&& cp src/index.html dist/index.html && webpack-dev-server
--content-base src/ --inline --hot'. 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 reactjs-basics package, npm ERR! not
with npm itself. npm ERR! Tell the author that this fails on your
system: npm ERR! webpack -d && cp src/index.html dist/index.html
&& webpack-dev-server --content-base src/ --inline --hot npm ERR! You
can get information on how to open an issue for this project with: npm
ERR! npm bugs reactjs-basics npm ERR! Or if that isn't available,
you can get their info via: npm ERR! npm owner ls reactjs-basics
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with anysupport request:
npm ERR!
/home/zx-coder/Downloads/reactjs-basics-master/npm-debug.log
npm ERR! Linux 4.15.0-29-generic npm ERR! argv "/usr/bin/node"
"/usr/bin/npm" "start" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm
ERR! code ELIFECYCLE npm ERR! reactjs-basics#1.0.0 start: `npm run
build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
reactjs-basics#1.0.0 start script 'npm run build'. 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 reactjs-basics package,
npm ERR! not with npm itself. npm ERR! Tell the author that this fails
on your system: npm ERR! npm run build npm ERR! You can get
information on how to open an issue for this project with: npm ERR!
npm bugs reactjs-basics npm ERR! Or if that isn't available, you can
get their info via: npm ERR! npm owner ls reactjs-basics npm ERR!
There is likely additional logging output above.
npm ERR! Please include the following file with anysupport request:
npm ERR!
/home/zx-coder/Downloads/reactjs-basics-master/npm-debug.log
The error is Error: listen EADDRINUSE 127.0.0.1:8080 which means there already is something that uses port 8080 on your machine, try changing the port webpack starts the dev server
solution 1: if your are beginner - just restart your PC.
solution 2: open task manager and kill all node instances.
alternatively you check if there is some other react app already running on port 8080 so you have to stop it
OR
you have to change your current app port to some other port.

npm start error angularjs(frontend)

$ npm start
angular-seed#0.0.0 prestart C:\wamp64\www\myapplication
npm install
npm WARN invalid config loglevel="notice"
angular-seed#0.0.0 postinstall C:\wamp64\www\myapplication
bower install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3
(node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY:
Unsupported platform for fsevents#1.1.3: wanted
{"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
up to date in 78.888s
angular-seed#0.0.0 start C:\wamp64\www\myapplication
http-server -a localhost -p 8001 -c-1 ./app
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8001
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at Server._listen2 (net.js:1262:14)
at listen (net.js:1298:10)
at net.js:1408:9
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! angular-seed#0.0.0
start: http-server -a localhost -p 8001 -c-1 ./app npm ERR! Exit
status 1 npm ERR! npm ERR! Failed at the angular-seed#0.0.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\AppData\Roaming\npm-cache_logs\2018-01-07T16_08_23_941Z-debug.log
i had this error when i run npm start frontend(angularjs)and in the symfony is run correctly can someone have a idea how can i solve.
Another process is already listening on port 8001. You are either trying to start your server twice, or there is another server/application which uses that port. The solution is to change the port or kill the process which listens on the same port.

How to build VSCode on Windows?

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.

install npm socket.io failure node version < 0.10.0

Im trying to install socket.io into my beagleboneblack, system says my node -v is v0.8.22 and for installation should be at least higher than 0.10.0.
but I can`t upgrade my node.
For installing socket.io, I enter the following text:
/usr/bin/ntpdate -b -s -u pool.ntp.org
cd /var/lib/cloud9
npm install socket.io
cp bonescript-socketio/* /var/lib/cloud9
Error message:
http GET https://registry.npmjs.org/socket.io-parser/2.3.1
WARN engine object-assign#4.1.0: wanted {"node":">=0.10.0"} (current: {"node":"v0.8.22","npm":"1.2.14"})
ERR! fetch failed https://registry.npmjs.org/ms/-ms-0.7.1.tgz
Error message upon completion:
npm ERR! Error: getaddrinfo ENOTFOUND
npm ERR! at errnoException (dns.js:37:11)
npm ERR! at Object.onanswer [as oncomplete] (dns.js:124:16)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.8.13
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "socket.io"
npm ERR! cwd /var/lib/cloud9
npm ERR! node -v v0.8.22
npm ERR! npm -v 1.2.14
npm ERR! syscall getaddrinfo
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm http GET https://registry.npmjs.org/ms/-/ms-0.7.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/ms/-/ms-0.7.1.tgz
npm http GET https://registry.npmjs.org/ms/-/ms-0.7.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/ms/-/ms-0.7.1.tgz
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/lib/cloud9/npm-debug.log
npm ERR! not ok code 0
for node upgrade I've tried
opkg update
but server seems to be down..
Appreciate your attention.
If you type in:
cat /etc/dogtag
you will get a readout. This readout tells you what version of Linux you have on your machine. If you go to http://elinux.org/Beagleboard:BeagleBoneBlack_Debian, the images are updated regularly for the BBB and BBG boards.
Try to update your image and then upgrade to the newer version of socket.io.
Seth
P.S. If this does not work, please let me know.

Categories

Resources