question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module '/root/.nvm/versions/node/v10.16.3/lib/node_modules/serverless/scripts/postinstall.js'

See original GitHub issue

Hi I am trying to upgrade the serverless version by running npm install serverless -g and I got error. npm -v = 6.13.1 node -v = v10.16.3

serverless@1.58.0 postinstall /root/.nvm/versions/node/v10.16.3/lib/node_modules/serverless node ./scripts/postinstall.js

module.js:549 throw err; ^

Error: Cannot find module ‘/root/.nvm/versions/node/v10.16.3/lib/node_modules/serverless/scripts/postinstall.js’ at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/serverless/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! serverless@1.58.0 postinstall: node ./scripts/postinstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the serverless@1.58.0 postinstall 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! /root/.npm/_logs/2019-11-21T01_20_07_129Z-debug.log

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
Dirvanncommented, Sep 14, 2020

it looks like it is working after I run the installation using sudo. Thank you for the responses and help.

Even when I was logged in as root I had to use sudo, then it worked.

4reactions
jastsaicommented, Nov 23, 2019

it looks like it is working after I run the installation using sudo. Thank you for the responses and help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve "Cannot find module" error using Node.js?
This error can be encountered if you are require ing a module that has a missing or incorrect main ...
Read more >
How to resolve "Cannot find module" error in Node - Sabe.io
The Cannot find module error is a common error that usually happens when dependencies are not installed. Once you install your dependencies and ......
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
you're trying to import an item from a module you don't have installed in your project directory; you're importing some things from an...
Read more >
Npm install not working. Cannot find module npm-cli.js
I'm getting the following error Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' In fact the bin ...
Read more >
How do I build a Lambda deployment package for Node.js?
Short description. The Cannot find module error usually occurs for one of three reasons: The Lambda function's deployment package doesn't have ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found