Error: Couldn't find preset "latest" relative to directory "/app"
Error: Couldn't find preset "latest" relative to directory "/app"
在我的 Deis 应用程序中收到错误;随着 Helmet to the frontend middleware. The app is initially based on React Boilerplate 的引入和我 运行 提出的大部分建议,我已经 implemented/explored 在源代码中并且仍在产生此 "phantom" 错误。
这仅发生在 Deis 应用程序实例上;在本地重现这些步骤时,完成(生产)构建过程的问题为零。
当然,我可以从中间件中删除helmet
,但是,我不想...
错误输出:
> pkg-name@0.0.1 start /app
> npm run start:production
> pkg-name@0.0.1 start:production /app
> npm run build && npm run start:prod
> pkg-name@0.0.1 build /app
> cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress
/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328
throw e;
^
2017-10-27T15:50:48+00:00 deis-app-name[]:
Error: Couldn't find preset "latest" relative to directory "/app"
at /app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
at Array.map (<anonymous>)
at OptionManager.resolvePresets (/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/app/node_modules/babel-register/lib/node.js:103:45)
at loader (/app/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .js] (/app/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:531:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pkg-name@0.0.1 build: `cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkg-name@0.0.1 build script.
依赖对象value/pair:
"dependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-eslint": "7.1.1",
"babel-loader": "6.2.10",
"babel-plugin-dynamic-import-node": "1.0.0",
"babel-plugin-react-intl": "2.2.0",
"babel-plugin-react-transform": "2.0.2",
"babel-plugin-transform-es2015-modules-commonjs": "6.18.0",
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-react-inline-elements": "6.8.0",
"babel-plugin-transform-react-remove-prop-types": "0.2.11",
"babel-preset-latest": "6.16.0",
"babel-preset-react": "6.16.0",
"babel-preset-react-hmre": "1.1.1",
"babel-preset-stage-0": "6.16.0",
"babel-polyfill": "6.20.0",
"basic-auth": "^2.0.0",
"bootstrap": "4.0.0-beta",
"chalk": "^1.1.3",
"cheerio": "0.22.0",
"circular-dependency-plugin": "2.0.0",
"classnames": "^2.2.5",
"compression": "1.6.2",
"cross-env": "3.1.3",
"css-loader": "0.26.1",
"dotenv": "^4.0.0",
"dotenv-safe": "^4.0.4",
"dotenv-webpack": "^1.5.4",
"eslint-import-resolver-webpack": "0.8.0",
"exports-loader": "0.6.3",
"express": "4.14.0",
"express-basic-auth": "^1.1.2",
"file-loader": "0.9.0",
"fontfaceobserver": "^2.0.13",
"helmet": "^3.9.0",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.24.1",
"image-webpack-loader": "2.0.0",
"immutable": "3.8.1",
"imports-loader": "0.6.5",
"intl": "1.2.5",
"invariant": "2.2.2",
"ip": "1.1.4",
"lodash": "4.17.2",
"minimist": "1.2.0",
"moment": "2.18.0",
"ngrok": "2.2.4",
"nsp": "^2.8.1",
"offline-plugin": "4.5.2",
"query-string": "^5.0.1",
"react": "15.4.1",
"react-addons-test-utils": "15.4.1",
"react-dom": "15.4.1",
"react-helmet": "3.2.2",
"react-intl": "2.1.5",
"react-paginate": "^4.4.4",
"react-redux": "4.4.6",
"react-router": "3.0.0",
"react-router-redux": "4.0.6",
"react-router-scroll": "0.4.1",
"react-scroll": "^1.5.5",
"react-widgets": "^4.0.2",
"react-widgets-moment": "^4.0.2",
"reactstrap": "^5.0.0-alpha.3",
"redux": "3.6.0",
"redux-form": "^7.0.4",
"redux-immutable": "3.0.8",
"redux-saga": "0.14.0",
"redux-saga-routines": "^2.0.2",
"reselect": "2.5.4",
"rimraf": "2.5.4",
"sanitize.css": "4.1.0",
"snyk": "^1.45.0",
"style-loader": "0.13.1",
"styled-components": "1.1.2",
"svg-sprite-loader": "^3.4.0",
"url-loader": "0.5.7",
"warning": "3.0.0",
"webpack": "2.2.0-rc.3",
"webpack-dev-middleware": "1.9.0",
"webpack-hot-middleware": "2.15.0",
"whatwg-fetch": "2.0.1"
},
"devDependencies": {
"coveralls": "2.11.15",
"enzyme": "2.6.0",
"eslint": "3.11.1",
"eslint-config-airbnb": "13.0.0",
"eslint-config-airbnb-base": "10.0.1",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.7.1",
"eslint-plugin-redux-saga": "0.1.5",
"eventsource-polyfill": "0.9.6",
"jest-cli": "18.0.0",
"lint-staged": "3.2.1",
"node-plop": "0.5.4",
"node-sass": "^4.5.3",
"null-loader": "0.1.1",
"plop": "1.7.3",
"pre-commit": "1.1.3",
"sass-loader": "^6.0.6",
"shelljs": "^0.7.5",
"sinon": "2.0.0-pre"
}
运行时配置:
- webpack: 2.2.0-rc.3
- babel 核心:6.26.0
- babel 加载器:6.18.0
- 头盔:3.9.0
环境工作流程:
- 运行 在 Deis 实例上 (kube & docker)
环境变量:
NODE_ENV production
NODE_MODULES_CACHE false
NPM_CONFIG_PRODUCTION true
其他资源:
我所做的 - 在开发中(在您的本地计算机上),我只是将所有最新的 babel deps 安装在祖父目录中。 Node.js 将遍历文件系统以查找其依赖项 (node_modules)。这样你就不必为每个项目都安装 Babel。这种技术甚至不需要 NODE_PATH
或 npm link
,它的工作原理如下:
$HOME/
projects/
node_modules/ # install all babel deps here
project-a/
project-b/
project-c/
或者,甚至更简单,您可以在 $HOME/node_modules
中安装 babel deps,这也可以。只是一个想法。这就是 Node.js 的工作方式——它沿着文件系统一直走到 $HOME,寻找 node_modules/x,如果在 $HOME/node_modules/x 中找不到它,那么它失败了。
我从 presest 数组中删除了“latest”,“prestes”等于 [“react”,“stage-0”]
在我的 Deis 应用程序中收到错误;随着 Helmet to the frontend middleware. The app is initially based on React Boilerplate 的引入和我 运行 提出的大部分建议,我已经 implemented/explored 在源代码中并且仍在产生此 "phantom" 错误。
这仅发生在 Deis 应用程序实例上;在本地重现这些步骤时,完成(生产)构建过程的问题为零。
当然,我可以从中间件中删除helmet
,但是,我不想...
错误输出:
> pkg-name@0.0.1 start /app
> npm run start:production
> pkg-name@0.0.1 start:production /app
> npm run build && npm run start:prod
> pkg-name@0.0.1 build /app
> cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress
/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328
throw e;
^
2017-10-27T15:50:48+00:00 deis-app-name[]:
Error: Couldn't find preset "latest" relative to directory "/app"
at /app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
at Array.map (<anonymous>)
at OptionManager.resolvePresets (/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/app/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/app/node_modules/babel-register/lib/node.js:103:45)
at loader (/app/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .js] (/app/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:531:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pkg-name@0.0.1 build: `cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkg-name@0.0.1 build script.
依赖对象value/pair:
"dependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-eslint": "7.1.1",
"babel-loader": "6.2.10",
"babel-plugin-dynamic-import-node": "1.0.0",
"babel-plugin-react-intl": "2.2.0",
"babel-plugin-react-transform": "2.0.2",
"babel-plugin-transform-es2015-modules-commonjs": "6.18.0",
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-react-inline-elements": "6.8.0",
"babel-plugin-transform-react-remove-prop-types": "0.2.11",
"babel-preset-latest": "6.16.0",
"babel-preset-react": "6.16.0",
"babel-preset-react-hmre": "1.1.1",
"babel-preset-stage-0": "6.16.0",
"babel-polyfill": "6.20.0",
"basic-auth": "^2.0.0",
"bootstrap": "4.0.0-beta",
"chalk": "^1.1.3",
"cheerio": "0.22.0",
"circular-dependency-plugin": "2.0.0",
"classnames": "^2.2.5",
"compression": "1.6.2",
"cross-env": "3.1.3",
"css-loader": "0.26.1",
"dotenv": "^4.0.0",
"dotenv-safe": "^4.0.4",
"dotenv-webpack": "^1.5.4",
"eslint-import-resolver-webpack": "0.8.0",
"exports-loader": "0.6.3",
"express": "4.14.0",
"express-basic-auth": "^1.1.2",
"file-loader": "0.9.0",
"fontfaceobserver": "^2.0.13",
"helmet": "^3.9.0",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.24.1",
"image-webpack-loader": "2.0.0",
"immutable": "3.8.1",
"imports-loader": "0.6.5",
"intl": "1.2.5",
"invariant": "2.2.2",
"ip": "1.1.4",
"lodash": "4.17.2",
"minimist": "1.2.0",
"moment": "2.18.0",
"ngrok": "2.2.4",
"nsp": "^2.8.1",
"offline-plugin": "4.5.2",
"query-string": "^5.0.1",
"react": "15.4.1",
"react-addons-test-utils": "15.4.1",
"react-dom": "15.4.1",
"react-helmet": "3.2.2",
"react-intl": "2.1.5",
"react-paginate": "^4.4.4",
"react-redux": "4.4.6",
"react-router": "3.0.0",
"react-router-redux": "4.0.6",
"react-router-scroll": "0.4.1",
"react-scroll": "^1.5.5",
"react-widgets": "^4.0.2",
"react-widgets-moment": "^4.0.2",
"reactstrap": "^5.0.0-alpha.3",
"redux": "3.6.0",
"redux-form": "^7.0.4",
"redux-immutable": "3.0.8",
"redux-saga": "0.14.0",
"redux-saga-routines": "^2.0.2",
"reselect": "2.5.4",
"rimraf": "2.5.4",
"sanitize.css": "4.1.0",
"snyk": "^1.45.0",
"style-loader": "0.13.1",
"styled-components": "1.1.2",
"svg-sprite-loader": "^3.4.0",
"url-loader": "0.5.7",
"warning": "3.0.0",
"webpack": "2.2.0-rc.3",
"webpack-dev-middleware": "1.9.0",
"webpack-hot-middleware": "2.15.0",
"whatwg-fetch": "2.0.1"
},
"devDependencies": {
"coveralls": "2.11.15",
"enzyme": "2.6.0",
"eslint": "3.11.1",
"eslint-config-airbnb": "13.0.0",
"eslint-config-airbnb-base": "10.0.1",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.7.1",
"eslint-plugin-redux-saga": "0.1.5",
"eventsource-polyfill": "0.9.6",
"jest-cli": "18.0.0",
"lint-staged": "3.2.1",
"node-plop": "0.5.4",
"node-sass": "^4.5.3",
"null-loader": "0.1.1",
"plop": "1.7.3",
"pre-commit": "1.1.3",
"sass-loader": "^6.0.6",
"shelljs": "^0.7.5",
"sinon": "2.0.0-pre"
}
运行时配置:
- webpack: 2.2.0-rc.3
- babel 核心:6.26.0
- babel 加载器:6.18.0
- 头盔:3.9.0
环境工作流程:
- 运行 在 Deis 实例上 (kube & docker)
环境变量:
NODE_ENV production
NODE_MODULES_CACHE false
NPM_CONFIG_PRODUCTION true
其他资源:
我所做的 - 在开发中(在您的本地计算机上),我只是将所有最新的 babel deps 安装在祖父目录中。 Node.js 将遍历文件系统以查找其依赖项 (node_modules)。这样你就不必为每个项目都安装 Babel。这种技术甚至不需要 NODE_PATH
或 npm link
,它的工作原理如下:
$HOME/
projects/
node_modules/ # install all babel deps here
project-a/
project-b/
project-c/
或者,甚至更简单,您可以在 $HOME/node_modules
中安装 babel deps,这也可以。只是一个想法。这就是 Node.js 的工作方式——它沿着文件系统一直走到 $HOME,寻找 node_modules/x,如果在 $HOME/node_modules/x 中找不到它,那么它失败了。
我从 presest 数组中删除了“latest”,“prestes”等于 [“react”,“stage-0”]