Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected identifier in one of your dependencies #17

Closed
evgenykon opened this issue Sep 4, 2019 · 1 comment
Closed

Comments

@evgenykon
Copy link

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
Copy link
Owner

This package requires Node.js 8, you're on Node.js 6:

https://github.com/avajs/find-cache-dir/blob/da06f099b74b7b7e836317ea80794700bdb32fad/package.json#L8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants