Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

vue serve --open src/App.vue no longer runs #7360

Unanswered
jasperf asked this question in Q&A
Mar 6, 2023 · 1 comments · 3 replies
Discussion options

When I run vue serve --open src/App.vue I get an error the script is not found:

Running npm run serve --open src/App.vue
npm ERR! Missing script: "serve"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/user/.npm/_logs/2023-03-06T05_41_19_346Z-debug-0.log
/Users/user/.npm-global/lib/node_modules/@vue/cli/node_modules/execa/index.js:174
                err = new Error(`Command failed: ${joinedCmd}${output}`);
                      ^

Error: Command failed: npm run serve --open src/App.vue
    at makeError (/Users/user/.npm-global/lib/node_modules/@vue/cli/node_modules/execa/index.js:174:9)
    at /Users/user/.npm-global/lib/node_modules/@vue/cli/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runNpmScript (/Users/user/.npm-global/lib/node_modules/@vue/cli/lib/util/runNpmScript.js:17:10) {
  code: 1,
  stdout: null,
  stderr: null,
  failed: true,
  signal: null,
  cmd: 'npm run serve --open src/App.vue',
  timedOut: false,
  killed: false

Now we do not have that script in the package.json. We only use

 "scripts": {
    "build": "npm run build:unpkg",
    "build:unpkg": "rollup --config build/rollup.config.js --format iife --file dist/Module.min.js"
  },

but we did not need this before either. It would just use the global package:

npm list -g 
/Users/user/.npm-global/lib
├── @vue/cli-service-global@4.5.19
├── @vue/cli-service@5.0.8
├── @vue/cli@5.0.8
├── @vue/devtools@6.5.0
└── @wordpress/env@5.10.0

our rollup.js vue package has

npm list   
appointment-button@1.2.3 /Users/user/code/smt-appointment-button
├── @rollup/plugin-buble@0.21.3
├── @rollup/plugin-commonjs@11.1.0
├── bootstrap-sass@3.4.1
├── jquery@3.6.0
├── rollup-plugin-vue@6.0.0
├── rollup@1.32.1
├── sass-loader@10.1.1
├── tinycolor2@1.4.2
├── vue-color@2.8.1
├── vue-template-compiler@2.6.12
├── vue@2.6.12
└── vuedraggable@2.24.3

and npm prefix is

npm config get prefix       
/Users/user/.npm-global

and general Node setup:

node --version && npm --version
v16.17.0
8.15.0
cat ~/.npmrc 
prefix=/Users/user/.npm-global
which node npm     
/usr/local/bin/node
/usr/local/bin/npm

node.org installed Node as you can see above..

How can I make Vue CLI and Vue Service work again globally without the need to move to Vite with this older Rollup.js Vue 2 package?

You must be logged in to vote

Replies: 1 comment · 3 replies

Comment options

At https://cli.vuejs.org/migrations/migrate-from-v4.html#for-all-packages I read

The instant prototyping functionalities are removed. Now the vue serve / vue build commands are aliases to npm run serve / npm run build, which in turn execute the scripts specified in the project package.json.
If you need a minimum setup for developing standalone .vue components, please use https://sfc.vuejs.org/ or https://vite.new/vue instead.

So perhaps I will need to update the entire package or move to Vite. Do hope to be able to stay where I am at for now though.

And due to rollup update the order in build/rollup.config.js also does not work.. Vue needs to be moved above common.js.. But that still does not allow a full built with vue cli as local package.. New solutions would we roll vue vite.. and Vite

You must be logged in to vote
3 replies
@LaoQinNa
Comment options

Sorry to take up your time. I used the filter attribute, but found that the corresponding element can't be dragged, but I can still replace its position with other elements. Is there an attribute that can set the element to be dragged or replaced by other elements?

@jasperf
Comment options

In the end I downgraded Rollup Vue Plugin, Rollup and Vue CLI. We will on an upgrade to Vite soon.

@LaoQinNa
Comment options

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.