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

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-ui\apollo-server\connectors\projects.js:349:11) at progress.wrap (C:\Users\xxxxx\AppData\Roaming\npm\node_modules@vue\cli\node_modules@vue\cli-ui\apollo-server\connectors\projects.js:341:12) at <anonymous> 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.

About this issue

Most upvoted comments

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-ui\apollo-server\connectors\projects.js:363:11) at C:\Users\xxx\AppData\Roaming\npm\node_modules@vue\cli\node_modules@vue\cli-ui\apollo-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-ui\apollo-server\connectors\progress.js:39:14)

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

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

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

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.

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.

Running PowerShell as admin fixed similar error for me

npm i --dev is work for me

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.

im so angry… Thank you @cfbauer. it was the camelcase issue

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 > fsevents@1.2.9: 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 > core-js@2.6.10: 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 > fsevents@1.2.9: 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 > left-pad@1.3.0: use String.prototype.padStart()"}
{"type":"warning","data":"\"@vue/cli-plugin-unit-jest > vue-jest@3.0.5\" has unmet peer dependency \"vue@^2.x\"."}
{"type":"warning","data":"\"@vue/cli-plugin-unit-jest > vue-jest@3.0.5\" has unmet peer dependency \"vue-template-compiler@^2.x\"."}
{"type":"warning","data":"\" > @vue/cli-service@4.0.5\" 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)