尝试在Windows上运行Failed to compile.
./src/App.js
Syntax error: Unexpected token (11:6)
9 | class App extends Component {
10 |
> 11 | const queryString = require('query-string');
| ^
12 | console.log(location.search);
13 |
14 | state = {flipped: false, currentCity: cities[0]};
时会导致错误
docker run --rm -v ${PWD}:/var/task lambci/lambda:build-nodejs10.x npm install bcrypt
我已经确认它可以在其他主机上正常运行,并且似乎是Windows操作系统,它在路径中丢失了。
如果我运行> bcrypt@3.0.6 install /var/task/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module '../'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/var/task/node_modules/bcrypt/node_modules/node-pre-gyp/bin/node-pre-gyp:15:20)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
,它将正常运行,这表明它不是docker映像问题。我该怎么做才能使初始命令正确执行?