Closed javidrashid closed 6 years ago
Hi!
Can you provide any more details? "Crate a project and install a npm package" is not enough. At least, I cannot reproduce this behaviour with those instructions.
you should be able to provide a repository with the changes that trigger the behaviour that you describe.
Did you try installing node-sass and sass-loader. I will see if I can create a sandbox environment to reproduce the issue. In the meantime I have added a couple of screenshots if that helps. I didn't had this issue if I install any other plugin/npm package, only with node-sass and sass-loader.
Screen Shot 1:
Screen 2:
Oh, so this is about the UI? you didn't mention that at all ....
Yes but it would even break the command line setup too. I just added UI screenshots for more clarity.
In that case, a sandbox would be apprechiated because I can't reproduce this so far.
Having trouble since today with this also. In my case, after wiping node_modules and running npm i
, I get Error: Cannot find module 'request'
on both npm run serve
and npm run build
.
If needed, I can try to reproduce in a repo.
the instructions will currently install 2.9.6
No.
npm install -g @vue/cli
# OR
yarn global add @vue/cli
This installs @vue/cli
which is 3.x.
2.x is vue-cli
.
I created a fresh project using the CLI tool + the same saved Vue app config file and the app ran fine. Turned out it was my package-lock.json
which was broken somehow, I can't figure out how. After replacing my package-lock.json
with the one from the fresh project (then re-added all other deps and installed them too), everything seems to work fine again.
node version: 8.11.2 npm version: 6.1.0
contents of my package.json
:
{
"name": "[redacted]",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit",
"docs": "jsdoc -c ./jsdoc.config.json"
},
"dependencies": {
"es6-promise": "^4.2.4",
"vue": "^2.5.16",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.0-beta.15",
"@vue/cli-plugin-eslint": "^3.0.0-beta.15",
"@vue/cli-plugin-unit-jest": "^3.0.0-beta.15",
"@vue/cli-service": "^3.0.0-beta.15",
"@vue/eslint-config-standard": "^3.0.0-rc.3",
"@vue/test-utils": "^1.0.0-beta.16",
"axios": "^0.18.0",
"axios-mock-adapter": "^1.15.0",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.0.1",
"jsdoc": "^3.5.5",
"jsdoc-vuejs": "^2.0.1",
"moment": "^2.22.2",
"moment-timezone": "^0.5.20",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-cli-plugin-webpack-bundle-analyzer": "^1.1.1",
"vue-template-compiler": "^2.5.16"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie < 8"
]
}
@javidrashid please update, did you had any luck solving this yet considering the given advice above to wipe package-lock
and reinstall.
@javidrashid I can't stop wondering, what is the reason to install node-sass
and sass-loader
at the first place? CLI offers SASS boilerplate automatically:
So it seems it was an issue with your local dev environment. Closing until a reliable way to reproduce is found.
@revelt : Apologies for the delay, I had already wiped out my client_side code before I could try the instructions of updating package-lock so can't confirm if that solves the issue. That said, I tried reproducing it again and no luck so @Akryum it is good to close for now.
good stuff!
I have the same issue on my projects with vue ui.
Result:
Task ... :serve ended with error code 1
@coolemur are you aware Vue CLI comes with SASS already pre-wired? https://github.com/vuejs/vue-cli/issues/1726#issuecomment-402615919 — I wonder why do you install sass-loader
and node-sass
?
If you select "Manually select features" > "CSS Preprocessors" you'll get SASS wired up automatically for you...
@revelt
When I try to use
<style lang="scss" scoped>
</style>
in my vue ui projects, error 'Can't resolve 'sass-loader'' appears. So I assume Vue ui doesn't come with sass pre-wired.
@coolemur OK, strange. Did you select "Manually select features" > "CSS Preprocessors" in the wizard during init stage?
I set up a blank project yesterday and hacked all evening and today morning in SASS, no problems.
@revelt Sorry. I missed a point that I need to Manually select it. Now it works just fine. Thank you.
@coolemur no probs happy to help
Version
3.0.0-rc.3
Reproduction link
http://no-url
Steps to reproduce
Install a node module say node-sass, sass-loader, Everything goes for a toss after that. and any command you run, build, serve or lint, The task fails with the message Task Error [serve, build, lint] Ended with error code 1
What is expected?
It should work.
What is actually happening?
The whole setup crashes and you can't even run the app if you start over.
I did some additional debugging and you see it reports missing of the core modules when it happens like;
$ vue-cli-service inspect --mode production module.js:549 throw err; ^
Error: Cannot find module 'request' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at /path/to/project/node_modules/request-promise-native/lib/rp.js:8:12 at module.exports (/path/to/project/node_modules/stealthy-require/lib/index.js:62:23) at Object. (/path/to/project/node_modules/request-promise-native/lib/rp.js:7:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)