-
Notifications
You must be signed in to change notification settings - Fork 921
Error: Cannot find module 'optimist' #517
Comments
have you ran |
maybe you should try |
@POTION4 I have tried to install
What could be happening? |
This should do the trick:
|
"npm install" is the problem because it wipes out node_modules leaving only the few it installs by default and nearly none of those required by c9. Doing "npm i optimist" and the rest, will eventually leave you with a few that c9 needs but don't exist elsewhere. I heard someone mention they cp'd the node_modules folder and replaced it after running the npm install but other than that... there has to be a cleaner way to do this... also the install-sdk script runs an npm install of sorts but editing this file is pointless because it does this weird thing where it gets replaced with a tmp. I was able to get the install script to run correctly and successfully by changing that crap bit of line "$NPM -production" to "npm install npm -g" (as basically a run once because the tmp replace) but of course it still wipes out the node_modules so maybe throw some "npm i"s in afterwards... |
install-sdk.sh already does npm install so no need to run that separately |
I had this problem, and I fixed it by doing 2 things:
After that, I ran the install script again, and it worked without an issue. Sounds like when this problem arises, something is halting the |
is it solved? |
I was finally able to uninstall and install a different way (which I had already tried when I posted previously) about a week later and it just worked.On Apr 14, 2020 8:13 PM, Laís Lima <[email protected]> wrote:
is it solved?
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.
|
ubuntu@:~/c9sdk$ node server.js
/home/ubuntu/c9sdk/node_modules/c9/setup_paths.js:34
throw e;
^
Error: Cannot find module 'optimist'
at Module._resolveFilename (module.js:547:15)
at Function.modules._resolveFilename (/home/ubuntu/c9sdk/node_modules/c9/setup_paths.js:27:16)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at main (/home/ubuntu/c9sdk/server.js:74:20)
at Object. (/home/ubuntu/c9sdk/server.js:55:5)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
The text was updated successfully, but these errors were encountered: