我正在使用gatsby mate产品组合,但是最近的本地开发在我运行npm start
时显示错误:
'sed' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-mate@2.5.1 fix-medium-plugin: `sed -i' ' 's//latest//g' ./node_modules/gatsby-source-medium/gatsby-node.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-mate@2.5.1 fix-medium-plugin script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
似乎没有正确转义s //
此处是其指定行的package.json
副本:
"name": "gatsby-starter-mate",
"version": "2.5.1",
"description": "Gatsby v2 starter to create a top notch portfolio!",
"main": "index.js",
"scripts": {
"fix-medium-plugin": "sed -i' ' 's/\/latest//g' ./node_modules/gatsby-source-medium/gatsby-node.js",
"prepare": "npm run fix-medium-plugin && gatsby clean",
"build": "npm run prepare && gatsby build",
"develop": "npm run prepare && gatsby develop",
"start": "npm run develop",
"serve": "npm run build && gatsby serve -p 9000",
"lint": "eslint ./src",
"setup": "node ./bin/setup.js",
"e2e:open": "cypress open",
"e2e:ci": "DETERMINISTIC=true start-server-and-test serve http://localhost:9000 'percy exec -- cypress run'"
},