NPM Start command not working
When I put in the command npm start to start magicmirror, i get this:
npm WARN npm npm does not support Node.js v10.15.2 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9. npm WARN npm You can find the latest version at https://nodejs.org/
[email protected] start /home/pi/MagicMirror sh run-start.sh
run-start.sh: 4: run-start.sh: electron: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: sh run-start.sh
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] 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! /home/pi/.npm/_logs/2019-08-31T15_34_25_041Z-debug.log
keep in mind that I am a complete noob and this is my first project. Thanks, any help would be greatly appreciated.
show us the output of npm -v
also try
sudo npm i -g npm
then check version again
if it changed, then go to MagicMirror folder and do
npm install
again
npm -v output is 5.8.0. After the sudo npm i -g npm the version didn't change. After putting in the sudo, this is what i got:
npm WARN npm npm does not support Node.js v10.15.2 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9. npm WARN npm You can find the latest version at https://nodejs.org/
Usage: npm
where
npm
Specify configs in the ini-formatted file:
/root/.npmrc
or on the command line via: npm
[email protected] /usr/share/npm \
You should try updating your Node version. I'm running 12.8.1 and it's working fine...
curl -sL https://deb.nodesource.com/setup_12.x | bash -
sudo apt-get install nodejs
Hi! Everyone, its sound like I may have a similar problems however I am using Windows with Node js installed
Here is the logs
53 silly lifecycle [email protected]~install: Args: [ '/d /s /c', 'cd vendor && npm install' ]
54 timing audit submit Completed in 805ms
55 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 806ms
56 timing audit body Completed in 5ms
57 silly lifecycle [email protected]~install: Returned: code: 0 signal: null
58 silly postinstall [email protected]
59 info lifecycle [email protected]~postinstall: [email protected]
60 verbose lifecycle [email protected]~postinstall: unsafe-perm in lifecycle true
61 verbose lifecycle [email protected]~postinstall: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Devan Nair\Documents\Projects\Smart Mirror\MagicMirror\node_modules.bin;C:\Users\Devan Nair\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Python36\Scripts;C:\Python36;C:\Program Files\Python36\Scripts;C:\Program Files\Python36;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Git\cmd;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\nodejs;C:\Users\Devan Nair\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\bin;C:\Users\Devan Nair\AppData\Roaming\npm
62 verbose lifecycle [email protected]~postinstall: CWD: C:\Users\Devan Nair\Documents\Projects\Smart Mirror\MagicMirror
63 silly lifecycle [email protected]~postinstall: Args: [ '/d /s /c',
63 silly lifecycle 'sh installers/postinstall/postinstall.sh && npm run install-fonts' ]
64 silly lifecycle [email protected]~postinstall: Returned: code: 1 signal: null
65 info lifecycle [email protected]~postinstall: Failed to exec postinstall script
66 verbose stack Error: [email protected] postinstall: sh installers/postinstall/postinstall.sh && npm run install-fonts
66 verbose stack Exit status 1
66 verbose stack at EventEmitter.sh installers/postinstall/postinstall.sh && npm run install-fonts
75 error Exit status 1
76 error Failed at the [email protected] postinstall script.
76 error This is probably not a problem with npm. There is likely additional logging output above.
77 verbose exit [ 1, true ]
can anyone please help
The Solutions was to Uninstall Node.JS completely
Install the most up to date Version. if running Git then open git -> $ npm -v 6.10.2
should show you build continue to add this code
$ npm install -g @angular/cli
this will help open up that npm in Visual Code.
hopefully this work
[email protected] start /home/pi/MagicMirror sh run-start.sh
run-start.sh: 4: run-start.sh: electron: not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! [email protected] start:
sh run-start.shnpm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the [email protected] 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! /home/pi/.npm/_logs/2019-08-31T15_34_25_041Z-debug.log
Are you sure you are in the MagicMirror/ directory when running npm start.
A safer way (on a standard raspberry pi install) is to try:
cd ~/MagicMirror && npm start
Should be solved in latest release. feel free to reopen.
I tried some of your methods, and now it is showing this, I have no clue what to do.
pi@raspberrypi:~/MagicMirror $ npm start /usr/lib/nodejs/aproba/index.js:1 (function (exports, require, module, __filename, __dirname) { ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
SyntaxError: Invalid or unexpected token at new Script (vm.js:79:7) at createScript (vm.js:251:10) at Object.runInThisContext (vm.js:303:10) at Module._compile (internal/modules/cjs/loader.js:657:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18)
Again, anything will help
npm is downlevel
do
sudo npm i -g npm
then try again
showed the same thing when i put it in and also when i tried again.
am having issues with my npm start. please i need help
C:\Users\hp\sample> npm start npm ERR! missing script: start
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\hp\AppData\Roaming\npm-cache_logs\2020-03-02T20_53_25_568Z-debug.log
C:\Users\hp\sample>
C:\Users\hp\sample> npm start
u need to be in the folder created by the install, typically called MagicMirror the folder will contain the package.json file for the MagicMirror app, and the 'start' script is defined there