Vue-cli: CLI does not generate project structure and fails with error NO_MODULES if running ui version

Created on 28 Sep 2018  Β·  20Comments  Β·  Source: vuejs/vue-cli

Version

3.0.4

Node and OS info

8.11.4

Steps to reproduce

Fresh install of NodeJS
Execute npm i -g @vue/cli
Execute vue create test-project and select default settings

What is expected?

A project structure to be created

What is actually happening?

'.git' directory created, package.json, package-lock.json and README.md files are created.

If using the vue ui then the above files are created and an error is thrown.

$ vue ui
πŸš€ Starting GUI...
🌠 Ready on http://localhost:8000
βš™ Installing CLI plugins. This might take a while...

up to date in 0.057s
πŸš€ Invoking generators...
πŸ“¦ Installing additional dependencies...

up to date in 0.042s

πŸŽ‰ Successfully created project Test.
πŸ‘‰ Get started with the following commands:

$ cd Test
$ npm run serve

Error: NO_MODULES
at importProject (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-uiapollo-server\connectors\projects.js:349:11)
at progress.wrap (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-uiapollo-server\connectors\projects.js:341:12)
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)


I have another computer with matching versions of npm, node and vue and it works fine. For some reason on this computer it fails to execute properly even after multiple restarts, completely removing node, npm, vue and node upgraded to latest version.

ui

Most helpful comment

This does not resolve the issue for me.

vue -V 3.7.0
node --version v12.3.1
Windows 10

After setting the NODE_ENV variable (and checking it) the error remains.
Error: NO_MODULES
at importProject (C:\Users\xxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-uiapollo-server\connectors\projects.js:363:11)
at C:\Users\xxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-uiapollo-server\connectors\projects.js:355:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Object.wrap (C:\Users\xxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-uiapollo-server\connectors\progress.js:39:14)

All 20 comments

is your environment set to production? I had the same problem, NODE_ENV was set to production, forgot to set it back to development.

Had the same issue with Windows 10 | Node 10.14.1 | CLI 3.2.1 , both from command line and ui version. @elcho007's solution worked for me.

In my case NODE_ENV was unset. when I set it to dev project creation finished fine.
Screenshot from 2019-05-22 11-51-19

is your environment set to production? I had the same problem, NODE_ENV was set to production, forgot to set it back to development.

Thanks for the tip

This does not resolve the issue for me.

vue -V 3.7.0
node --version v12.3.1
Windows 10

After setting the NODE_ENV variable (and checking it) the error remains.
Error: NO_MODULES
at importProject (C:\Users\xxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-uiapollo-server\connectors\projects.js:363:11)
at C:\Users\xxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-uiapollo-server\connectors\projects.js:355:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Object.wrap (C:\Users\xxx\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-uiapollo-server\connectors\progress.js:39:14)

Same problem here both on 4.0.5, 3.12, 3.11

Environment a docker image FROM node:12.13.0-alpine3.10

where the only operation was installing @vue/cli@version

Operations done through vue UI
Here results:

πŸš€  Starting GUI...
🌠  Ready on http://0.0.0.0:8000
-  Creating project in /code/project/project.
✨  Creating project in /code/project/project.
{"type":"warning","data":"@vue/cli-plugin-babel > webpack > watchpack > chokidar > [email protected]: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size"}
{"type":"warning","data":"@vue/cli-plugin-pwa > workbox-webpack-plugin > workbox-build > strip-comments > babel-plugin-transform-object-rest-spread > babel-runtime > [email protected]: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3."}
{"type":"warning","data":"@vue/cli-plugin-unit-jest > babel-jest > @jest/transform > jest-haste-map > [email protected]: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size"}
{"type":"warning","data":"@vue/cli-plugin-unit-jest > jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > [email protected]: use String.prototype.padStart()"}
{"type":"warning","data":"\"@vue/cli-plugin-unit-jest > [email protected]\" has unmet peer dependency \"vue@^2.x\"."}
{"type":"warning","data":"\"@vue/cli-plugin-unit-jest > [email protected]\" has unmet peer dependency \"vue-template-compiler@^2.x\"."}
{"type":"warning","data":"\" > @vue/[email protected]\" has unmet peer dependency \"vue-template-compiler@^2.0.0\"."}
-  Running completion hooks...
βš“  Running completion hooks...
-  Generating README.md...
πŸ“„  Generating README.md...
Error: NO_MODULES
    at importProject (/usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/projects.js:363:11)
    at /usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/projects.js:355:12
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.wrap (/usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/progress.js:39:14)

Seems to have something to do with the existance of the project folder.
In the folder /code I already had another folder called "project"
In the UI I declered that I wanted to create a new project in: "/code/project" and checked the "overwrite if existing" checkbox.
As can be seen in the code the UI wrongly start working in "/code/project/project".
Probably this generates problems in the skeleton generation.
When trying to create a project "test" in the folder /code all works correctly.

npm i --dev is work for me

Seems to have something to do with the existance of the project folder.
In the folder /code I already had another folder called "project"
In the UI I declered that I wanted to create a new project in: "/code/project" and checked the "overwrite if existing" checkbox.
As can be seen in the code the UI wrongly start working in "/code/project/project".
Probably this generates problems in the skeleton generation.
When trying to create a project "test" in the folder /code all works correctly.

Had the same error and solved it with the same solution: Deleting the folder you want to override.

I am having the exact same error nothing is working I have tried setting my NODE_ENV to development. I have tried setting up the project in a new folder and running it inside of that folder and nothing seems to fix it. What is very odd to me is that the logs will show that I am indeed running a newer version of the CLI. I am unsure how to fix this issue, granted the GUI is an awesome feature to VUE i might still stick with the command line elements to creating a project as they dont seem to cause an error

I had the same problem and it was because of my npm access rights so I did a sudo chown -R $USER /usr/local/lib/node_modules
and also updated the core-js package with npm install -g core-js

@wildthreshold That worked for me. Thanks, amigo.

I tried everything in this thread with no luck. Inspired by @VeegY's suggestion I noticed that when I created a folder for the app using CamelCase it was getting converted to all lowercase, then stopping at creation with the Error: NO_MODULES issue.

I named the folder in all lowercase which seems to fix the issue. The dashboard page hangs on creation but after closing the tab and restarting vue ui everything seems to be working.

npm i --dev is work for me

For me too !!!!!

I tried everything in this thread with no luck. Inspired by @VeegY's suggestion I noticed that when I created a folder for the app using CamelCase it was getting converted to all lowercase, then stopping at creation with the Error: NO_MODULES issue.

I named the folder in all lowercase which seems to fix the issue. The dashboard page hangs on creation but after closing the tab and restarting vue ui everything seems to be working.

That worked for me too! thank you

I had the same problem and it was because of my npm access rights so I did a sudo chown -R $USER /usr/local/lib/node_modules
and also updated the core-js package with npm install -g core-js

Just to confirm that this worked for me. Big thanks!

I'm using windows.
When i change NODE_ENV to dev its working, but only in my git bash terminal.
When i use a windows terminal, somehow, it doesnΒ΄t really work to change the NODE_ENV!
However, i would recommend to use the git bash (also because i don't like the windows terminal), change the node_env

export NODE_ENV=dev
echo $NODE_ENV

and after that, run

winpty vue.cmd create hello-world

This was working for me, finally! (I'm using minTTY, also see: https://cli.vuejs.org/guide/creating-a-project.html#vue-create)

@sKnodel are you re-opening the windows command prompt after changing NODE_ENV? Windows and many other operating systems cache the environment variables per terminal so you would have to close them and re-open them before the NODE_ENV value would take effect.

@Yamaha32088 yes, i reopened the windows command prompt. Now, when i try to echo $NODE_ENV (also tried NODE_ENV or %NODE_ENV%) i always get the variable name, not the value of $NODE_ENV. Its different in git bash, where i get the value. I think there is propably a different syntax? Or i do something wrong. However, it works for me in git bash, actually i never use the windows command prompt for other things, so it's fine

is your environment set to production? I had the same problem, NODE_ENV was set to production, forgot to set it back to development.

it works for me thanx

Was this page helpful?
0 / 5 - 0 ratings