作者:ndo2205188 | 来源:互联网 | 2024-11-05 20:48
在安装lib-flexible时,遇到了`saveErrorENOENT:Nosuchfileordirectory`错误,具体表现为无法打开`E:\Github\SDIO\package.json`文件。解决此问题的关键在于确保项目根目录下存在`package.json`文件,并且在正确的项目路径中执行安装命令。建议先检查项目结构,确认文件是否存在,然后再尝试重新安装依赖。
saveError ENOENT: no such file or directory, open 'E:\Github\SDIO\package.json'
需要在项目下安装,在有package.json这级目录安装
ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
ajv没有导入
配置
需要敲的部分:(自己看着复制吧)
const px2remLoader = {
loader: 'px2rem-loader',
options:{
remUnit:75
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
// const loaders = options.usePostCSS ? [cssLoader, px2remLoader] : [cssLoader]
const loaders = [cssLoader, px2remLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
之后重启就好 npm run dev