npm ERR! missing script: start #15444

Closed
reyadrahman opened this Issue Jan 11, 2017 · 9 comments

Projects

None yet

2 participants

@reyadrahman

I'm opening this issue because:

-npm doesnot loading my app and sending me missing script error

What's going wrong?

This is the npm debug log
here is my package.json - https://gist.github.com/reyadrahman/a6d87309c3be7af9455718753260b099

I don't understand what's wrong ? I've read others post here regarding this issue and tried to solve myself but failed.

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@4.0.3
3 info using node@v6.9.2
4 verbose config Skipping project config: C:\Users\reyadrahman/.npmrc. (matches userconfig)
5 verbose stack Error: missing script: start
5 verbose stack at run (C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:151:19)
5 verbose stack at C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:61:5
5 verbose stack at C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:356:5
5 verbose stack at checkBinReferences_ (C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:320:45)
5 verbose stack at final (C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:354:3)
5 verbose stack at then (C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:124:5)
5 verbose stack at ReadFileContext. (C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:308:29)
5 verbose stack at ReadFileContext.callback (C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
5 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:365:13)
6 verbose cwd C:\Users\reyadrahman\Desktop\play
7 error Windows_NT 10.0.10586
8 error argv "C:\Program Files\nodejs\node.exe" "C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start"
9 error node v6.9.2
10 error npm v4.0.3
11 error missing script: start
12 error If you need help, you may report this error at:
12 error https://github.com/npm/npm/issues
13 verbose exit [ 1, true ]

@KenanY
Member
KenanY commented Jan 11, 2017

@reyadrahman So that's the contents of C:\Users\reyadrahman\Desktop\play\package.json, right?

@reyadrahman

@KenanY yes .

@KenanY
Member
KenanY commented Jan 11, 2017

@reyadrahman What's the output of npm run?

@reyadrahman

Lifecycle scripts included in reyadrahman:
test
echo "Error: no test specified" && exit 1

@KenanY
Member
KenanY commented Jan 11, 2017

Sorry but I'm convinced that you are not running that command from with the same directory as the package.json with "name": "angular-quickstart" :/

What does type package.json print?

@reyadrahman

This is what I've done a while ago. What is it I am doing wrong every time? :(

C:\Users\reyadrahman\Desktop\play>cd angular-quickstart

C:\Users\reyadrahman\Desktop\play\angular-quickstart>npm run
Lifecycle scripts included in angular-quickstart:
start
node main.js

available via npm run-script:
lite
lite-server

C:\Users\reyadrahman\Desktop\play\angular-quickstart>

@KenanY
Member
KenanY commented Jan 11, 2017

@reyadrahman Run npm start from within C:\Users\reyadrahman\Desktop\play\angular-quickstart. In your original error you were not within that directory....

@reyadrahman

Now!!

C:\Users\reyadrahman\Desktop\play\angular-quickstart>npm start

angular-quickstart@1.0.0 start C:\Users\reyadrahman\Desktop\play\angular-quickstart
node main.js

module.js:471
throw err;
^

Error: Cannot find module 'C:\Users\reyadrahman\Desktop\play\angular-quickstart\main.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.9.2
npm ERR! npm v4.0.3
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 start: node main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 start script 'node main.js'.
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 angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\reyadrahman\Desktop\play\angular-quickstart\npm-debug.log

The I've Added main.js file... :(

C:\Users\reyadrahman\Desktop\play\angular-quickstart>npm start

angular-quickstart@1.0.0 start C:\Users\reyadrahman\Desktop\play\angular-quickstart
node main.js

C:\Users\reyadrahman\Desktop\play\angular-quickstart\main.js:7
})(window.app || (window.app = {}));
^

ReferenceError: window is not defined
at Object. (C:\Users\reyadrahman\Desktop\play\angular-quickstart\main.js:7:4)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\reyadrahman\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.9.2
npm ERR! npm v4.0.3
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 start: node main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 start script 'node main.js'.
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 angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\reyadrahman\Desktop\play\angular-quickstart\npm-debug.log

@KenanY
Member
KenanY commented Jan 11, 2017

@reyadrahman window is defined in the browser, not in Node.js. Closing since this is no longer an issue with npm itself.

@KenanY KenanY closed this Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment