Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm is crashing (missing script) #14309

Closed
13 tasks
ankamfc opened this issue Oct 17, 2016 · 14 comments
Closed
13 tasks

npm is crashing (missing script) #14309

ankamfc opened this issue Oct 17, 2016 · 14 comments

Comments

@ankamfc
Copy link

ankamfc commented Oct 17, 2016

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

How can the CLI team reproduce the problem?

Package.json -

"scripts": {
"start": "node ./scripts/build.js && webpack-dev-server --inline --content-base subjects",
"server-exercise": "supervisor -- -r babel-register subjects/ServerRendering/exercise/server.js",
"server-solution": "supervisor -- -r babel-register subjects/ServerRendering/solution/server.js",
"lint": "eslint subjects/*/.js",
"test": "npm run lint"
},

npm-debug.log ->

supporting information:

  • npm -v prints:
  • node -v prints:
  • npm config get registry prints:
  • Windows, OS X/macOS, or Linux?:
  • Network issues:
    • Geographic location where npm was run:
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don't use a proxy, but have limited or unreliable internet access.
  • Container:
    • I develop using Vagrant on Windows.
    • I develop using Vagrant on OS X or Linux.
    • I develop / deploy using Docker.
    • I deploy to a PaaS (Triton, Heroku).
@kenany
Copy link
Contributor

kenany commented Oct 17, 2016

@ankamfc I don't see a npm-debug.log file attached to your post. Could you please provide one?

@ankamfc
Copy link
Author

ankamfc commented Oct 17, 2016

npm-debug
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   'lint' ]
2 info using npm@2.15.9
3 info using node@v4.6.0
4 verbose config Skipping project config: C:\Users\sankam/.npmrc. (matches userconfig)
5 verbose stack Error: missing script: lint
5 verbose stack     at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:142:19)
5 verbose stack     at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:58:5
5 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:356:5
5 verbose stack     at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:320:45)
5 verbose stack     at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:354:3)
5 verbose stack     at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:124:5)
5 verbose stack     at ReadFileContext.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:295:20)
5 verbose stack     at ReadFileContext.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
5 verbose stack     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:303:13)
6 verbose cwd C:\Users\sankam\Desktop\gitCode
7 error Windows_NT 6.1.7601
8 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "lint"
9 error node v4.6.0
10 error npm  v2.15.9
11 error missing script: lint
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
Copy link
Contributor

kenany commented Oct 17, 2016

@ankamfc What does npm run print?

@ankamfc
Copy link
Author

ankamfc commented Oct 17, 2016

@kenany
npm run -

C:\Users\sankam\Desktop\gitCode>npm run
Lifecycle scripts included in sankam:
  test
    echo "Error: no test specified" && exit 1

@kenany
Copy link
Contributor

kenany commented Oct 17, 2016

@ankamfc Is the package.json you provided in the original post not the same as C:\Users\sankam\Desktop\gitCode\package.json?

@ankamfc
Copy link
Author

ankamfc commented Oct 17, 2016

@kenany Its part of it.
Here is the whole file .

{
  "description": "Course material for http://reactjs-training.com",
  "repository": "ReactJSTraining/react-subjects",
  "license": "GPL-3.0",
  "authors": [
    "Ryan Florence",
    "Michael Jackson"
  ],
  "scripts": {
    "start": "node ./scripts/build.js && webpack-dev-server --inline --content-base subjects",
    "server-exercise": "supervisor -- -r babel-register subjects/ServerRendering/exercise/server.js",
    "server-solution": "supervisor -- -r babel-register subjects/ServerRendering/solution/server.js",
    "lint": "eslint subjects/**/*.js",
    "test": "npm run lint"
  },
  "dependencies": {
    "angular": "1.5.8",
    "assert": "1.4.1",
    "babel-loader": "^6.2.4",
    "babel-plugin-transform-object-assign": "^6.5.0",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-stage-1": "^6.5.0",
    "babel-register": "^6.9.0",
    "backbone": "^1.2.3",
    "bootstrap": "^3.3.4",
    "bootstrap-webpack": "0.0.5",
    "css-loader": "^0.23.1",
    "events": "^1.0.2",
    "expect": "^1.13.4",
    "exports-loader": "^0.6.3",
    "expose-loader": "^0.7.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.9.0",
    "firebase": "^2.4.2",
    "flux": "^2.0.1",
    "form-serialize": "0.7.1",
    "immstruct": "^2.0.0",
    "immutable": "^3.7.3",
    "imports-loader": "0.6.5",
    "invariant": "^2.1.0",
    "isomorphic-fetch": "^2.2.1",
    "jquery": "^3.1.0",
    "jsonp": "0.2.0",
    "key-mirror": "^1.0.1",
    "less": "^2.7.1",
    "less-loader": "^2.2.3",
    "md5": "2.1.0",
    "mkdirp": "^0.5.0",
    "mocha": "3.0.2",
    "mustache": "^2.2.1",
    "purecss": "0.6.0",
    "react": "^15.1.0",
    "react-addons-css-transition-group": "^15.1.0",
    "react-addons-perf": "^15.1.0",
    "react-addons-test-utils": "^15.1.0",
    "react-addons-transition-group": "^15.1.0",
    "react-dom": "^15.1.0",
    "react-motion": "^0.4.2",
    "react-point": "^2.1.0",
    "react-redux": "^4.4.5",
    "react-router": "^2.0.0-rc4",
    "react-tween-state": "0.1.5",
    "redux": "3.0.4",
    "redux-logger": "2.2.1",
    "redux-thunk": "1.0.0",
    "sort-by": "^1.1.0",
    "style-loader": "^0.13.1",
    "supervisor": "^0.11.0",
    "underscore": "^1.8.3",
    "url-loader": "^0.5.6",
    "webpack": "^1.7.3",
    "webpack-dev-server": "^1.8.0"
  },
  "devDependencies": {
    "babel-eslint": "^6.1.2",
    "eslint": "^3.2.2",
    "eslint-import-resolver-webpack": "^0.5.1",
    "eslint-plugin-import": "^1.13.0",
    "eslint-plugin-react": "^6.0.0"
  }
}

@kenany
Copy link
Contributor

kenany commented Oct 17, 2016

@ankamfc Hmm, how odd. Does this also occur with the latest stable release of npm?

@ankamfc
Copy link
Author

ankamfc commented Oct 17, 2016

I am new to this. I installed the latest release of node . And it is currently running 2.15.9 after i ran an npm update . ANd am getting the same error . @kenany

@zkat
Copy link
Contributor

zkat commented Oct 17, 2016

This is a weird package.json -- version and name are required. I can't reproduce this right now (on OSX) but it might be a Windows issue. Can you try adding those two fields to your package.json and trying again?

@ankamfc
Copy link
Author

ankamfc commented Oct 18, 2016

@zkat added both the fields and tried and didn have any luck .

@zkat
Copy link
Contributor

zkat commented Oct 18, 2016

@ankamfc: what is the exact path of that package.json that you posted?

@iarna
Copy link
Contributor

iarna commented Oct 18, 2016

I've looked at this and I'm certain that the package.json you shared is not in C:\Users\sankam\Desktop\gitCode\.

This is important, because that's where you're running npm run from.

The reason I'm so sure is because the output of npm run indicates it was reading a package.json that looks VERY different from the one you shared:

  1. It says Lifecycle scripts included in sankam: and sankam is the package name. You didn't have a package name in your package.json. If you use npm run without a package name then it would have said Lifecycle scripts included in :.

  2. It reports your only lifecycle script as being:

    test
      echo "Error: no test specified" && exit 1
    

    That's the default lifecycle that's created for an empty project. It's also not what's in the package.json that you shared with us.

If I'm correct then to resolve this you need to make sure that your command line is in the same folder as the package.json you shared with us. That is, you need to cd \folder\where\your\project\is.

@ankamfc
Copy link
Author

ankamfc commented Oct 18, 2016

@iarna Thank you for that . That worked .

@kenany
Copy link
Contributor

kenany commented Oct 18, 2016

Closing as resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants