Vagrant中strapi无法连接MongoDB的一个Bug

这算不算一个BUG呢,上周在本机折腾strapi一直卡在Testing database connection...这个环节,它会报出以下错误信息:

⏳ Testing database connection...
{ Error: Command failed: npm install --production --ignore-scripts
npm WARN deprecated [email protected]: 'postcss-cssnext' has been deprecated in favor of 'postcss-preset-env'. Read more at https://moox.io/blog/deprecating-cssnext/
npm WARN deprecated [email protected]: This project is no longer maintained.
npm WARN deprecated bfj-node[email protected]: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/minimatch/package.json.3623971025'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/concat-map/package.json.3179440667'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/balanced-match/package.json.2328920575'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/fs.realpath/package.json.4175887507'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/brace-expansion/package.json.3787619622'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/wrappy/package.json.3992012059'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/inherits/package.json.3281249561'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/resolve/package.json.3363842181'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/rechoir/package.json.1368486961'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/inflight/package.json.4204978107'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/shelljs/package.json.2278241903'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/path-parse/package.json.3180165126'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/once/package.json.2036807406'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/glob/package.json.2072785403'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/react-ga/package.json.1393274175'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/mnt/strapi/demo/admin/node_modules/remove-markdown/package.json.3844259073'
npm WARN bootstrap@4.1.3 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-11-27T10_13_16_869Z-debug.log

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:182:13)
    at ChildProcess.EventEmitter.emit (domain.js:441:20)
    at maybeClose (internal/child_process.js:978:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'npm install --production --ignore-scripts' }

后来在Github的这个Issues中得知这是node引起的问题:在vagrant中做了宿主机器的映射目录中使用strapi new project-name这样的命令就会出现这样的问题。

解决方法

换一个没做映射的目录。

Post Comment