Home > OS >  ENOTDIR error on npm install (npm 3 over node 4. I know: legacy. Sorry :( )
ENOTDIR error on npm install (npm 3 over node 4. I know: legacy. Sorry :( )

Time:06-17

First of all, my apologies for reporting a problem of npm3 here, but it looks like the old repo is currently in read only mode.

We have a big and old angularjs frontend app, that requires node4 and uses npm3. A couple of days ago, a problem raised when someone performed a npm install.

error

npm ERR! Linux 4.19.0-13-amd64
npm ERR! argv "/home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqq/abc-batch-qqq/node/node" "/home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqq/abc-batch-qqq/node/node_modules/npm/bin/npm-cli.js" "install"
npm ERR! node v4.4.3
npm ERR! npm  v3.10.10
npm ERR! path /home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqq/abc-batch-qqq/node_modules/.staging/@types/node-69b48d6f/package.json
npm ERR! code ENOTDIR
npm ERR! errno -20
npm ERR! syscall open

npm ERR! ENOTDIR: not a directory, open '/home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqq/abc-batch-qqq/node_modules/.staging/@types/node-69b48d6f/package.json'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

package.json

{
  "name": "abc",
  "version": "0.0.0",
  "description": "Description for abc",
  "private": true,
  "cacheDirectories": [
    "node_modules",
    "src/main/webapp/bower_components"
  ],
  "devDependencies": {
    "bower": "1.7.9",
    "browser-sync": "2.12.10",
    "del": "2.2.1",
    "eslint-config-angular": "0.5.0",
    "eslint-plugin-angular": "1.3.1",
    "event-stream": "3.3.4",
    "generator-jhipster": "3.4.2",
    "gulp": "3.9.1",
    "gulp-angular-filesort": "1.1.1",
    "gulp-angular-templatecache": "2.0.0",
    "gulp-autoprefixer": "3.1.0",
    "gulp-changed": "1.3.1",
    "gulp-cssnano": "2.1.2",
    "gulp-eslint": "3.0.1",
    "gulp-flatten": "0.3.0",
    "gulp-footer": "1.0.5",
    "gulp-htmlmin": "2.0.0",
    "gulp-if": "2.0.1",
    "gulp-imagemin": "3.0.2",
    "gulp-inject": "4.1.0",
    "gulp-natural-sort": "0.1.1",
    "gulp-ng-annotate": "2.0.0",
    "gulp-ng-constant": "1.1.0",
    "gulp-notify": "2.2.0",
    "gulp-plumber": "1.1.0",
    "gulp-rename": "1.2.2",
    "gulp-replace": "0.5.4",
    "gulp-rev": "7.1.0",
    "gulp-rev-replace": "0.4.3",
    "gulp-sourcemaps": "1.6.0",
    "gulp-uglify": "1.5.4",
    "gulp-useref": "3.1.0",
    "jasmine-core": "2.4.1",
    "karma": "1.1.2",
    "karma-chrome-launcher": "1.0.1",
    "karma-coverage": "1.1.1",
    "karma-jasmine": "1.0.2",
    "karma-junit-reporter": "1.1.0",
    "karma-phantomjs-launcher": "1.0.1",
    "karma-script-launcher": "1.0.0",
    "lazypipe": "1.0.1",
    "lodash": "4.14.0",
    "main-bower-files": "2.13.1",
    "map-stream": "0.0.6",
    "phantomjs-prebuilt": "2.1.9",
    "proxy-middleware": "0.15.0",
    "run-sequence": "1.2.2",
    "xml2js": "0.4.16",
    "yargs": "4.8.1",
    "useref": "1.4.1",
    "esquery": "1.0.1"
   },
  "engines": {
    "node": "^4.3"
  },
  "scripts": {
    "test": "gulp test"
  }
}

npm-debug

warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
150443 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
150444 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
150444 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
150444 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
150444 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
150445 warn [email protected] requires a peer of encoding@^0.1.0 but none was installed.
150446 verbose If you need help, you may report this error at:
150446 verbose     <https://github.com/npm/npm/issues>
150447 verbose stack Error: ENOTDIR: not a directory, open '/home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqqq/abc-batch-qqqq/node_modules/.staging/@types/node-69b48d6f/package.json'
150447 verbose stack     at Error (native)
150448 verbose cwd /home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqqq/abc-batch-qqqq
150449 error Linux 4.19.0-13-amd64
150450 error argv "/home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqqq/abc-batch-qqqq/node/node" "/home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqqq/abc-batch-qqqq/node/node_modules/npm/bin/npm-cli.js" "install"
150451 error node v4.4.3
150452 error npm  v3.10.10
150453 error path /home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqqq/abc-batch-qqqq/node_modules/.staging/@types/node-69b48d6f/package.json
150454 error code ENOTDIR
150455 error errno -20
150456 error syscall open
150457 error ENOTDIR: not a directory, open '/home/pparker/workspaces/eclipse/abc/abc_refactor/abc_qqqq/abc-batch-qqqq/node_modules/.staging/@types/node-69b48d6f/package.json'
150458 error If you need help, you may report this error at:
150458 error     <https://github.com/npm/npm/issues>
150459 verbose exit [ -20, true ]

I cannot upgrade to newer npm versions, because of the angularjs app and dependencies. I tried to move to npm6, but the application also packaging stopped working

Anyone have any clues about this? I'm completely desperated...

Thanks in advance and sorry again.

CodePudding user response:

Just solved the issue. It's because there's a file called tmp in the home directory.

rm -rf ~/tmp
sudo npm cache clear
sudo npm install -g node

Also... if you are trying to install npm then the same error and solution applies - delete ~/tmp

CodePudding user response:

Try npm v6.10.3

npm install -g [email protected]

Won't hurt for trying it out. If possible can you provide error logs for packaging stopped working?

  • Related