![](/img/trans.png)
[英]Is it possible to run a build for particular change in Gatsby Project?
[英]Unable to run Gatsby project
當我運行 Gatsby v2.19.19 時出現以下錯誤
Gatsby requires Node.js 14.15.0 or higher (you have v12.13.0)
問題是如果我切換到高於 14.15.0 的任何版本,無論我做什么,我的一些依賴項都不會安裝。 例如, gatsby-plugin-favicon
gatsby-transformer-sharp
gatsby-plugin-sharp
都依賴於名為sharp
的package
我也無法使用節點 v12 安裝依賴項,然后切換到 v14 並運行相同 package 的項目原因(文檔明確 state 必須在相同版本的節點上安裝和運行)
此外,在 Gatsby v2 -> v3 遷移指南中,它說 v3 所需的最低節點版本是 12.13.0。 鑒於我使用的是 v2,它甚至應該低於這個值,因此我不明白說我必須擁有 14.15.0 或更高版本的錯誤。
這是我的package.json
文件
"scripts": {
"develop": "gatsby develop",
"build:develop": "OSS_ENV=staging gatsby build",
"build": "OSS_ENV=production gatsby build",
"serve": "gatsby serve"
},
"dependencies": {
"@stripe/stripe-js": "^1.13.1",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"email-validator": "^2.0.4",
"express": "^4.17.1",
"gatsby-plugin-google-tagmanager": "^2.1.25",
"gatsby-plugin-robots-txt": "^1.5.0",
"gatsby-plugin-sitemap": "^2.2.27",
"pngquant-bin": "^6.0.0",
"superagent": "^6.1.0"
},
"devDependencies": {
"antd": "^3.26.11",
"axios": "^0.21.1",
"gatsby": "^2.19.18",
"gatsby-image": "^2.2.41",
"gatsby-plugin-antd-v2": "^1.0.3",
"gatsby-plugin-favicon": "^3.1.6",
"gatsby-plugin-less": "^4.7.0",
"gatsby-plugin-react-helmet": "^3.1.22",
"gatsby-plugin-sass": "^3.2.0",
"gatsby-plugin-sharp": "^2.4.5",
"gatsby-plugin-typescript": "^2.1.27",
"gatsby-source-filesystem": "^2.1.48",
"gatsby-source-ghost": "^4.2.2",
"gatsby-transformer-sharp": "^2.3.14",
"less": "^4.1.1",
"node-sass": "^5.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"react-icons": "^4.2.0"
}
在節點 v14.15.0 或更高版本上安裝我上面提到的軟件包時遇到的錯誤
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.23.4 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.23.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.