My Vue app (trooia.netlify.app) builds locally, but throws build errors when deployed, see log:
Any hints? Thx!
Hey there and welcome!
Would you mind showing us the contents of your package.json
file? It looks like you’ve got an incorrect dependency on a javascript package named trooia
which does not seem to exist on npm.
Sure, but there is no such package in my package.json:
{
“name”: “trooia”,
“scripts”: {
“start”: “./nvm.sh && vue-cli-service serve”,
“build”: “./nvm.sh && vue-cli-service build”
},
“dependencies”: {
“axios”: “^0.21.1”,
“bootstrap”: “^4.5.0”,
“bootstrap-vue”: “^2.15.0”,
“core-js”: “^3.6.5”,
“geoip-lite”: “^1.4.2”,
“vue”: “^2.6.11”,
“vue-router”: “^3.2.0”,
“vuex”: “^3.4.0”
},
“devDependencies”: {
“@vue /cli-plugin-babel”: “~4.5.0”,
“@vue /cli-plugin-eslint”: “~4.5.0”,
“@vue /cli-plugin-router”: “~4.5.0”,
“@vue /cli-plugin-vuex”: “~4.5.0”,
“@vue /cli-service”: “~4.5.0”,
“babel-eslint”: “^10.1.0”,
“eslint”: “^6.7.2”,
“eslint-plugin-vue”: “^6.2.2”,
“vue-template-compiler”: “^2.6.11”
}
}
Hey there, @MajorNoobie
Thanks for writing in! Sorry you are having trouble with your build.
This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem
We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!
If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, etc. Thanks!
I looked into this a bit and it seems to be a known problem with @vue/cli-service
and npm
unfortunately.
opened 04:28PM - 08 Feb 21 UTC
closed 03:09PM - 04 Mar 21 UTC
### Version
4.5.11
### Environment info
```
System:
OS: Linux 5.4 Ub… untu 18.04.4 LTS (Bionic Beaver)
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 12.17.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/bin/yarn
npm: 7.5.2 - ~/npm-global/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
@vue/babel-helper-vue-jsx-merge-props: 1.2.1
@vue/babel-helper-vue-transform-on: 1.0.2
@vue/babel-plugin-jsx: 1.0.3
@vue/babel-plugin-transform-vue-jsx: 1.2.1
@vue/babel-preset-app: 4.5.11
@vue/babel-preset-jsx: 1.2.4
@vue/babel-sugar-composition-api-inject-h: 1.2.1
@vue/babel-sugar-composition-api-render-instance: 1.2.4
@vue/babel-sugar-functional-vue: 1.2.2
@vue/babel-sugar-inject-h: 1.2.2
@vue/babel-sugar-v-model: 1.2.3
@vue/babel-sugar-v-on: 1.2.3
@vue/cli-overlay: 4.5.11
@vue/cli-plugin-babel: ~4.5.0 => 4.5.11
@vue/cli-plugin-eslint: ~4.5.0 => 4.5.11
@vue/cli-plugin-router: 4.5.11
@vue/cli-plugin-vuex: 4.5.11
@vue/cli-service: ~4.5.0 => 4.5.11
@vue/cli-shared-utils: 4.5.11
@vue/component-compiler-utils: 3.2.0
@vue/preload-webpack-plugin: 1.1.2
@vue/web-component-wrapper: 1.2.0
eslint-plugin-vue: ^6.2.2 => 6.2.2
vue: ^2.6.11 => 2.6.12
vue-eslint-parser: 7.4.1
vue-hot-reload-api: 2.3.4
vue-loader: 15.9.6 (16.1.2)
vue-style-loader: 4.1.2
vue-template-compiler: ^2.6.11 => 2.6.12
vue-template-es2015-compiler: 1.9.1
npmGlobalPackages:
@vue/cli: 4.5.11
```
### Steps to reproduce
Run
```
vue create project_name
```
to create a vue project and then choose vue 2. Then
```
cd project_name && npm update
```
### What is expected?
Dependencies updated
### What is actually happening?
receive an error says "ERESOLVE unable to resolve dependency tree"
Detail:
```
$ npm update
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: project_name@0.1.0
npm ERR! Found: vue@2.6.12
npm ERR! node_modules/vue
npm ERR! vue@"^2.6.11" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"3.0.5" from @vue/compiler-sfc@3.0.5
npm ERR! node_modules/@vue/compiler-sfc
npm ERR! peerOptional @vue/compiler-sfc@"^3.0.0-beta.14" from @vue/cli-service@4.5.11
npm ERR! node_modules/@vue/cli-service
npm ERR! dev @vue/cli-service@"~4.5.0" from the root project
npm ERR! 1 more (@vue/cli-plugin-babel)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
```
---
`peerDependenciesMeta` used in @vue/cli-service causes unexpected behavior on npm 7
It seems to install fine with yarn though so you could try to remove (if you have one) your package-lock.json
and run yarn install
in your directory. Then add the yarn.lock to your repository in order for Netlify to pick yarn instead of npm. At least until they fix the underlying issue. You’d probably -not- want to use --legacy-peer-deps
as they suggest in the issue since that might mess other things up.
Let us know if that solves it!
Thanks, good to know! I did a clean reinstall and it works so far…