SyntaxError: Unexpected identifier in one of your dependencies
Closed this issue · 1 comments
evgenykon commented
Problem:
> ./node_modules/webpack/bin/webpack.js --mode=production
/srv/quinto-circle/node_modules/compression-webpack-plugin/node_modules/pkg-dir/index.js:5
const pkgDir = async cwd => {
^^^
SyntaxError: Unexpected identifier
at NativeCompileCache._moduleCompile (/srv/quinto-circle/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
at Module._compile (/srv/quinto-circle/node_modules/v8-compile-cache/v8-compile-cache.js:186:36)
at Object.Module._extensions..js (module.js:579:10)
...
npm ERR! Linux 4.4.0-75-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.10.3/bin/node" "/home/vagrant/.nvm/versions/node/v6.10.3/bin/npm" "run" "webpack"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
My package.json dependencies
{
...
"dependencies": {
"chart.js": "^2.8.0",
"chartjs-plugin-labels": "^1.1.0",
"jquery": "^3.4.1"
},
"devDependencies": {
"babel-loader": "^7.1.5",
"compression-webpack-plugin": "^3.0.0",
"node-sass": "^4.12.0",
"webpack": "^4.39.3",
"webpack-cli": "^3.3.7"
}
}
Looking in plugin dependencies, and found that bugged version of pkg-dir
placed in your package dependencies
$cd node_modules/compression-webpack-plugin
$ find . -name "*.json" -type f -exec grep -H '"pkg-dir":' {} \;
./node_modules/find-cache-dir/package.json: "pkg-dir": "^4.1.0"
sindresorhus commented
This package requires Node.js 8, you're on Node.js 6: