Closed dimavolo closed 6 years ago
Please provide a valid reproduction when opening an issue.
@sodatea please explain how it would be possible to provide a reproduction for this issue.
Like, the project repository created by vue create
.
Okay, here is a repository that I created with vue create
:
https://asciinema.org/a/spTomiYQM8FPUuPhpPucA9S9r
Cannot reproduce on macOS.
Have you tried rm -rf node_modules
and npm install
again?
This works fine on my macOS. The issue is on Ubuntu 16.04 with nvm.
Yes, I have tried rm -rf node_modules
and reinstall.
Still can't reproduce with a fresh install of nvm
& node
.
https://asciinema.org/a/hRDyrM5HcDHVieV3mPLEVlhdL
Maybe the $PATH
variable is somehow messed up in your environment.
Please let me know what executables the $PATH should include.
Have you tested in Ubuntu 16.04? On Thu, 30 Aug 2018 at 11:47 PM Haoqun Jiang notifications@github.com wrote:
Still can't reproduce with a fresh install of nvm & node. https://asciinema.org/a/hRDyrM5HcDHVieV3mPLEVlhdL
Maybe the $PATH variable is somehow messed up in your environment.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vuejs/vue-cli/issues/2404#issuecomment-417346214, or mute the thread https://github.com/notifications/unsubscribe-auth/AK5OkJWsFS1XqKD0gNGEUWqFB9OnB00Mks5uV_r1gaJpZM4WThwJ .
Yes, I've posted the terminal session recorded in Ubuntu 16.04 above.
I don't know if this helps but here's my $PATH:
/home/soda/.nvm/versions/node/v8.11.4/bin:/home/soda/bin:/home/soda/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
This is most likely an npm
issue (for not prepending ./node_modules/.bin
to $PATH
). So please also try updating npm
version.
Also, try to call it by npx:
npx vue-cli-service build
Closing due to inactivity for more than 1 week. Please open a new issue with a reference to this one if you can follow up with more information.
I had a similar situation with Ubuntu 18.04
To fix this situation, I had to add the following line to my .zshrc
(maybe in your case is .bashrc
)
export PATH="$(yarn global bin):$PATH"
Effectively, the yarn global bin
is a folder where vue (vue cli 3) was placed
This was a suggestion from a yarn issue
Yeah, don't close this issue please. I'm getting this as well. vue-cli-service: not found
Hi, everyone, I've got the same error.
Apparently, I try to build the app locally, and it works fine.
But when I push the code to github, and the arrival of a new commit triggers travis-ci build job, and it gives me the error which is "/bin/sh: 1: vue-cli-service: not found".
https://github.com/whizjs/superjs/blob/master/.travis.yml
By the way, travis-ci has been working fine util this latest commit.
I don't know where to start the debug.
same issue here on ubuntu 18.04.. i just tried a complete reinstall of nodejs and npm and deleted all global node_modules
Hi,
I have exactly the same error for gitlab-ci:
yarn run v1.12.3 $ vue-cli-service build /bin/sh: 1: vue-cli-service: not found info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 127. ERROR: Job failed: exit code 1
Had similar issues as above and this worked
sudo npm cache clean -f
rm -rf node_modules package-lock.json && npm install
worked for me
Tried all the options above nothing worked for me
If you look at https://cli.vuejs.org/guide/cli-service.html it tells you that after installing @vue/cli-service ( which may be part of the standard CLI installation ) then vue-cli-service is available in npm scripts, but that if you want to access it directly then you need to use ./node_modules/.bin/vue-cli-service This worked for me, and I guess you could add ./node_modules/.bin to your $PATH if you were so inclined.
Of course the last comment is the one that holds the answer for me. Resolved by prepending my command with ./node_modules/.bin/
I think @PeterA1 could be right.
I had an issue when I had NODE_ENV set to production, which was, quite for sure, incorrect for this script to execute. Changed back to development, and everything is fine again.
Tried all of the suggestions above and still having this issue with OS X 10.14.2. vue --version
displays 3.3.0.
npm cache clean -f
worked for me thanks!
I had the same problem when building on Bitbucket Pipelines. The solution was, similar to above, to go to pipelines, select Caches, mouseover the node_modules dependency cache and click the trashcan icon.
on ubuntu I fixed this by:
1) uninstalled my old npm that was installed using apt install
apt-get remove npm
2) installed nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash
3) restarted terminal
4) installed latest npm using nvm
nvm install --latest-npm
5) reinstall packages as suggested by diachedelic
rm -rf node_modules package-lock.json && npm install
I got it working with npx vue-cli-service ...
Not sure if this is the correct solution, but deleting node_modules and npm install didn't solve it for me. It looks like you need to install @vue/cli-service and any plugins you use globally. Here's my solution: Host: Windows 10
Dockerfile
FROM node:8.10-stretch
# update npm & install vue cli peer dependencies
RUN npm install -g npm
RUN npm install -g @vue/cli @vue/cli-service @vue/cli-plugin-babel @vue/cli-plugin-eslint
WORKDIR /app
COPY package*.json ./
RUN npm ci
VOLUME /app
CMD npm run serve
docker-compose.yml
version: "3.5"
services:
ui:
build:
context: ui/
ports:
- 3000:80
volumes:
- ./ui/:/app
- shadow-ui:/app/node_modules:delegated # see comment below
stdin_open: true
tty: true
environment:
CHOKIDAR_USEPOLLING: 'true'
volumes:
shadow-ui: # see comment below
The shadow-ui
volume prevents the node_modules directory on my host (windows) from being mounted into my container (debian), so npm ci
will download the correct binaries for node-sass. This error presents itself as "Could not find package vue-template-compiler" or something similar.
if happened while building docker image, try to remove NODE_ENV=production
before npm install
or yarn install
.
sudo yarn install fixed mine thanks @hyuckgi
I think this issue needs to be re-opened because I have got this error simply by deleting my node_modules and re-running npm install from inside the root directory of the application. Running $ vue create project-name allows for npm run serve to work correctly.
that fixs me:
edit package.json
-> scripts
, change vue-cli-service
to node_modules/.bin/vue-cli-service
I also get it, will check if @microJ 's solution fixes it.
See...
Of course the last comment is the one that holds the answer for me. Resolved by prepending my command with
./node_modules/.bin/
This issue seems to be caused by several user environment related issues (unrelated to vue-cli):
node_modules
, which can be caused by bad installation of the project packages ➡️ delete node_module
and reinstall (deleting package-lock.json
or yarn.lock
too before reinstalling can also help):
in the path, for example /Users/julien/programming:work/path/to/my-app
(PATH
separator is the :
character)https://stackoverflow.com/questions/40546231/sh-react-scripts-command-not-found-after-running-npm-start https://stackoverflow.com/questions/47612580/react-scripts-command-not-found?rq=1 https://github.com/facebook/create-react-app/issues/3256#issuecomment-340259809 https://github.com/facebook/create-react-app/issues/3256#issuecomment-358406611 https://stackoverflow.com/questions/47842849/how-to-resolve-sh-react-scripts-command-not-found https://npm.community/t/npm-script-cant-find-module-without-the-full-path/1344/15
rm -rf node_modules package-lock.json && npm install
worked for me
this works for me
rm -rf node_modules package-lock.json && npm install
为我工作
thanks
I did npm install
and that was enough for me.
Works if you run the "npm install" in "cmd", but not in powershell.
I'm using ubuntu inside windows 10. In my case the problem WAS the Malwarebytes :( it was blocking some update in my npm install!
I got the same error in WSL ubuntu on Win 10.
My solution was to call ./node_modules/.bin/vue-cli-service
; i.e. ./node_modules/.bin/vue-cli-service build --mode development
.
Hey!
This is the correct solution: you need to install @vue/cli-service
module.
Using NPM
$ npm i -S @vue/cli-service
Using Yarn
$ yarn add @vue/cli-service
Hey! This is the correct solution: you need to install
@vue/cli-service
module. Using NPM$ npm i -S @vue/cli-service
Using Yarn
$ yarn add @vue/cli-service
Its Worked for me.
Hey! This is the correct solution: you need to install
@vue/cli-service
module. Using NPM$ npm i -S @vue/cli-service
Using Yarn
$ yarn add @vue/cli-service
Its Worked for me. If it doesent work, do this again, and call it like this
./node_modules/.bin/vue-cli-service
The only thing that worked for me was going to plugins menu at Vue UI interface and download '@vue/cli-service' from there
If you use NPM package manager you need move dependencies in package.json from "devDependencies" to "dependencies". Then NPM on Heroku will install them and vue-cli-service can build your app.
npm install -g @vue/cli-service-global
npm install -g @vue/cli-service-global
This is the another correct way... Always works for me.
I had an issue when I had NODE_ENV set to production, which was, quite for sure, incorrect for this script to execute. Changed back to development, and everything is fine again.
That resolved it for me, thanks!
Version
3.0.1
Node and OS info
nvm 0.33.1 / Node v8.11.4 / Ubuntu 16.04
Steps to reproduce
npm run build fails because
vue-cli-service: command not found
What is expected?
npm run build succeeds
What is actually happening?
npm run build fails because
vue-cli-service: command not found
Installed globally with
npm install -g @vue/cli@latest