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

Yo fails to run after install #785

Open
zubair1103 opened this issue Apr 19, 2023 · 18 comments
Open

Yo fails to run after install #785

zubair1103 opened this issue Apr 19, 2023 · 18 comments

Comments

@zubair1103
Copy link

zubair1103 commented Apr 19, 2023

Type of issue


My environment

  • OS version/details: Ubuntu 22.04.2 LTS (via WSL 2)
  • Node version: v18.16.0
  • npm version: 9.5.1
  • Version of yo : 4.3.0

Expected behavior

yo command should work as normal

Current behavior

After installing the yo globally I tried to run yo command but it is throwing the error. See shell output below.
Error is different for different versions of yo with same steps.

Steps to reproduce the behavior

Install Ubuntu on WSL 2
Install NVM
Install Node
Install Yo

Command line output

root@SLT92Zubair:/# yo
/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/conf/index.js:128
                        throw err;
                        ^

Error: EACCES: permission denied, open '/root/.config/insight-nodejs/insight-yo.json'
    at Object.openSync (node:fs:601:3)
    at Object.readFileSync (node:fs:469:35)
    at get store [as store] (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/conf/index.js:108:18)
    at Conf.get (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/conf/index.js:47:27)
    at get optOut [as optOut] (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/insight/lib/index.js:52:22)
    at Object.<anonymous> (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js:208:48)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12) {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: '/root/.config/insight-nodejs/insight-yo.json'
}

Node.js v18.16.0
root@SLT92Zubair:/#

NOTE:

PLEASE NOTE THAT Yo 4.3.1 THROWS A DIFFERENT ERROR WHILE PERFORMING SAME STEPS

root@SLT92Zubair:/# yo --version
4.3.1
root@SLT92Zubair:/# node -v
v18.16.0
root@SLT92Zubair:/# npm -v
9.5.1
root@SLT92Zubair:/# yo
node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module 'is-ci'
Require stack:
- /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js
- /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at lazy (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/import-lazy/index.js:2:51)
    at /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/import-lazy/index.js:10:11
    at new UpdateNotifier (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js:46:4)
    at module.exports (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js:183:25)
    at updateCheck (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js:54:20)
    at Object.<anonymous> (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js:187:1) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js',
    '/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js'
  ]
}

Node.js v18.16.0
root@SLT92Zubair:/#
@shayeLee
Copy link

I encountered the same problem.

@Mitschiro
Copy link

Same Error
Windows 11 -> WSL 2 -> Ubuntu 22.04.2

`Error: Cannot find module 'is-ci'
Require stack:

  • /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js
  • /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at lazy (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/import-lazy/index.js:2:51)
    at /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/import-lazy/index.js:10:11
    at new UpdateNotifier (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js:46:4)
    at module.exports (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js:183:25)
    at updateCheck (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js:54:20)
    at Object. (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js:187:1) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js',
    '/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js'
    ]
    }`

@ytnytn1
Copy link

ytnytn1 commented May 29, 2023

Same Error Windows 11 -> WSL 2 -> Ubuntu 22.04.2

`Error: Cannot find module 'is-ci' Require stack:

  • /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js
  • /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at lazy (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/import-lazy/index.js:2:51)
    at /root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/import-lazy/index.js:10:11
    at new UpdateNotifier (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js:46:4)
    at module.exports (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js:183:25)
    at updateCheck (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js:54:20)
    at Object. (/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js:187:1) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/node_modules/update-notifier/index.js',
    '/root/.nvm/versions/node/v18.16.0/lib/node_modules/yo/lib/cli.js'
    ]
    }`

I have the same error in win 10, wsl2

@g-taiji-tanaka
Copy link

Same Error.
Win10
WSL2
Ubuntu 22.04.2
Node 18.16.0
npm 9.5.1

@BaschtianXD
Copy link

I encountered the same error.
Win 11, WSL2, Ubuntu 22.04.2, Node 18.16.0, npm 9.5.1

@verikono
Copy link

verikono commented Aug 1, 2023

bumpty bump bump.
Win 11, WSL2, Ubuntu 22.04.2, Node 20.5.0, npm 9.8.1

edit: found the issue to be the root user login - ie. I was logging into the WSL2/Ubuntu container as root. Added myself as as user and set that to the default login and yo performs as expected.

@danboggins
Copy link

danboggins commented Feb 1, 2024

Running into the same problem on Ubuntu (no WSL):

root@host:/opt/ppp/TEST# yo
node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module 'is-ci'
Require stack:
- /root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/node_modules/update-notifier/index.js
- /root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/lib/cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at lazy (/root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/node_modules/import-lazy/index.js:2:51)
    at /root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/node_modules/import-lazy/index.js:10:11
    at new UpdateNotifier (/root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/node_modules/update-notifier/index.js:46:4)
    at module.exports (/root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/node_modules/update-notifier/index.js:183:25)
    at updateCheck (/root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/lib/cli.js:54:20)
    at Object.<anonymous> (/root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/lib/cli.js:190:1) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/node_modules/update-notifier/index.js',
    '/root/.nvm/versions/node/v20.11.0/lib/node_modules/yo/lib/cli.js'
  ]
}

If I attempt to run yo as a user:

testuser@host:/opt/ppp/TEST$ yo
Error: Not supported
    at init (/usr/local/lib/node_modules/yo/lib/cli.js:122:23)
    at pre (/usr/local/lib/node_modules/yo/lib/cli.js:83:9)
    at /usr/local/lib/node_modules/yo/lib/cli.js:193:9
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:194:3)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)

node: 20.11.0
npm: 10.2.4
Ubuntu: 20.04 LTS

@mvsenin
Copy link

mvsenin commented Mar 27, 2024

How, how, how... same issue (almost)
image

Is there any thought on that?

Thanks.

@SBoudrias
Copy link
Member

@mvsenin you should upgrade node to an LTS version. Unsupported versions can be dangerous for your business and your users.

Now this is affecting yo, but once fixed on our dependencies, it risks appearing on another library. You'll be playing whack a mole with dependencies until you upgrade to an LTS Node version (18 as of now). https://nodejs.org/en/about/previous-releases

@mvsenin
Copy link

mvsenin commented Mar 29, 2024

@SBoudrias Hi Simon, thanks, I've done that, node version is 20.12.0, but now I'm getting the Error: Cannot find module 'is-ci'...

@Physicalpixel
Copy link

Did we find a solution to this?

@zubair1103
Copy link
Author

After wasting few days on this, I finally installed it using WSL 2 + Ubuntu + root user then installed Superset in Ubuntu instead of Windows. This way it worked for me.

@gbamqzkdyg
Copy link

I am facing the error today on Windows 11.

yo code
Error: Not supported
    at init (C:\Users\lucama\AppData\Roaming\npm\node_modules\yo\lib\cli.js:122:23)
    at pre (C:\Users\lucama\AppData\Roaming\npm\node_modules\yo\lib\cli.js:83:9)
    at C:\Users\lucama\AppData\Roaming\npm\node_modules\yo\lib\cli.js:193:9
    at Object.<anonymous> (C:\Users\lucama\AppData\Roaming\npm\node_modules\yo\lib\cli.js:194:3)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11

image

@epaezrubio
Copy link

This issue deserves more attention IMO. At the moment the yo command is unusable on WSL :(

@YinYang117
Copy link

YinYang117 commented Jul 9, 2024

Fresh global instal of yo on wsl 2 with windows 11.
run command: yo code

`node:internal/modules/cjs/loader:1147
throw err;
^

Error: Cannot find module 'is-ci'
Require stack:

  • /root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/node_modules/update-notifier/index.js
  • /root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/lib/cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at lazy (/root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/node_modules/import-lazy/index.js:2:51)
    at /root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/node_modules/import-lazy/index.js:10:11
    at new UpdateNotifier (/root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/node_modules/update-notifier/index.js:46:4)
    at module.exports (/root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/node_modules/update-notifier/index.js:183:25)
    at updateCheck (/root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/lib/cli.js:54:20)
    at Object. (/root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/lib/cli.js:190:1) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/node_modules/update-notifier/index.js',
    '/root/.nvm/versions/node/v20.11.1/lib/node_modules/yo/lib/cli.js'
    ]`

@d-duer
Copy link

d-duer commented Aug 14, 2024

Echoing verikono's comment that installing and using yo from a user other than root fixes this.

@epaezrubio
Copy link

I agree that that is a workaround, but I wouldn't consider it a fix. Specially since no other npm packages (that I know) have this issue.

@hilleer
Copy link

hilleer commented Nov 1, 2024

bumpty bump bump. Win 11, WSL2, Ubuntu 22.04.2, Node 20.5.0, npm 9.8.1

edit: found the issue to be the root user login - ie. I was logging into the WSL2/Ubuntu container as root. Added myself as as user and set that to the default login and yo performs as expected.

There is a lot of unknowns in this workaround :-) Would you mind describing (or linking) how to achieve this?

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