Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install failed #877

Closed
koolay opened this issue Jul 26, 2017 · 8 comments
Closed

npm install failed #877

koolay opened this issue Jul 26, 2017 · 8 comments

Comments

@koolay
Copy link

koolay commented Jul 26, 2017

protobuf.js version: 6.8.0

> protobufjs@6.8.0 postinstall /opt/www/xxx/node_modules/protobufjs
> node scripts/postinstall

module.js:472
    throw err;
    ^

Error: Cannot find module '/opt/www/xxx/node_modules/protobufjs/scripts/postinstall'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

@download13
Copy link

I'm getting a very similar error on an ARM6 system.

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! protobufjs@6.8.0 postinstall: `node scripts/postinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the protobufjs@6.8.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

EDIT: Fixed this by making sure node was installed in a default PATH location. Not sure why that worked, but after copying the node files into /usr/local/ everything worked fine.

@koolay
Copy link
Author

koolay commented Aug 22, 2017

npm install --unsafe-perm worked.

@ea167
Copy link

ea167 commented Feb 5, 2020

Still the same problem with the latest version (6.8.8).
My NodeJs is installed under /opt/node/

> protobufjs@6.8.8 postinstall /root/my-project/node_modules/protobufjs
> node scripts/postinstall

internal/modules/cjs/loader.js:796
    throw err;
    ^

Error: Cannot find module '/root/my-project/node_modules/protobufjs/scripts/postinstall'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! protobufjs@6.8.8 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the protobufjs@6.8.8 postinstall script.

@kritzware
Copy link

Also having the same issue on 6.8.8, after installing as a global module via npm or yarn:

$ npm install -g protobufjs

When attempting to run:

$ pbjs -t json googleapis//google/ads/googleads/v3/enums/*.proto googleapis//google/ads/googleads/v3/errors/*.proto googleapis//google/ads/googleads/v3/common/*.proto > ./scripts/compiled-enums.json
installing semver@^5.5.0
child_process.js:660
    throw err;
    ^

Error: Command failed: npm --silent install semver@^5.5.0
    at checkExecSyncError (child_process.js:621:11)
    at Object.execSync (child_process.js:657:15)
    at modInstall (/usr/lib/node_modules/protobufjs/cli/util.js:129:19)
    at Object.exports.setup (/usr/lib/node_modules/protobufjs/cli/util.js:140:9)
    at Object.<anonymous> (/usr/lib/node_modules/protobufjs/cli/pbjs.js:7:6)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19) {
  status: 243,
  signal: null,
  output: [ null, null, null ],
  pid: 7911,
  stdout: null,
  stderr: null
}

Versions:
protobufjs: ^6.8.8
node: 12.14.1
npm: 6.13.4

@joshystuart
Copy link

This is happening to me too:

Versions:
OS: Windows 10
protobufjs: 6.10.2
node: 14.15.1
yarn: 1.22.5

@alexander-fenster
Copy link
Contributor

This will be fixed by #1234 and in v7.0 when the CLI tools will go to a separate package with their own dependencies.

@tedvanderveen
Copy link

tedvanderveen commented Dec 18, 2020

Same issue here. Any updates on #1234?

@TimDaub
Copy link

TimDaub commented Dec 23, 2021

npm install --unsafe-perm worked.

I'm having this issue today on

uname -a
Linux ubuntu-2gb-nbg1-1 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Edit: Installing dependencies seemed to have worked with yarn.

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

No branches or pull requests

8 participants