我正在尝试这个模板的工作,但它不断给我的错误在npm启动。我已经尝试过重新安装npm、清除npm-cache和更改版本。我在package.json文件中找不到任何错误。
这里有个错误,
npm start
npm ERR! file /home/singhanurag9080/Downloads/material-react/material-kit-react-master/package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token { in JSON at position 27 while parsing near '...ckfileVersion": 1
npm ERR! JSON.parse }
npm ERR! JSON.parse {
npm ERR! JSON.parse "name": "materia...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
package.JSON { "name": "material-kit-react", "version": "1.8.0", "description": "Material Kit React. Coded by Creative Tim", "private": true, "main": "dist/index.js", "dependencies": { "@material-ui/core": "4.3.2", "@material-ui/icons": "4.2.1", "classnames": "2.2.6", "history": "4.9.0", "moment": "2.24.0", "node-sass": "4.12.0", "nouislider": "14.0.2", "prop-types": "15.7.2", "react": "16.9.0", "react-datetime": "2.16.3", "react-dom": "16.9.0", "react-router-dom": "5.0.1", "react-scripts": "3.1.0", "react-slick": "0.25.2", "react-swipeable-views": "0.13.3" }, "devDependencies": { "@babel/cli": "7.5.5", "@babel/plugin-proposal-class-properties": "7.5.5", "@babel/preset-env": "7.5.5", "@babel/preset-react": "7.0.0", "eslint-config-prettier": "6.0.0", "eslint-plugin-prettier": "3.1.0", "eslint-plugin-react": "7.14.3", "gulp": "4.0.2", "gulp-append-prepend": "1.0.8", "prettier": "1.18.2" }, "optionalDependencies": { "typescript": "3.5.3" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build && gulp licenses", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", "lint:check": "eslint . --ext=js,jsx; exit 0", "lint:fix": "eslint . --ext=js,jsx --fix; exit 0", "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start", "build-package-css": "node-sass src/assets/scss/material-kit-react.scss dist/material-kit-react.css", "build-package": "npm run build-package-css && babel src --out-dir dist", "compile-sass": "node-sass src/assets/scss/material-kit-react.scss src/assets/css/material-kit-react.css", "minify-sass": "node-sass src/assets/scss/material-kit-react.scss src/assets/css/material-kit-react.min.css --output-style compressed", "map-sass": "node-sass src/assets/scss/material-kit-react.scss src/assets/css/material-kit-react.css --source-map true" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [] } }
0 info it worked if it ends with ok
1 verbose cli [ '/home/singhanurag9080/.nvm/versions/node/v10.16.3/bin/node',
1 verbose cli '/home/singhanurag9080/.nvm/versions/node/v10.16.3/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g' ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose npm-session 5398ffab8abd9470
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for file: Unexpected token { in JSON at position 27
8 timing stage:rollbackFailedOptional Completed in 1ms
9 timing stage:runTopLevelLifecycles Completed in 22ms
10 verbose stack SyntaxError: Unexpected token { in JSON at position 27
10 verbose stack at JSON.parse (<anonymous>)
10 verbose stack at module.exports (/home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/pacote/lib/util/read-json.js:14:15)
10 verbose stack at tryCatcher (/home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
10 verbose stack at Promise._settlePromiseFromHandler (/home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
10 verbose stack at Promise._settlePromise (/home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
10 verbose stack at Promise._settlePromise0 (/home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
10 verbose stack at Promise._settlePromises (/home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:694:18)
10 verbose stack at Promise._fulfill (/home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
10 verbose stack at /home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
10 verbose stack at /home/singhanurag9080/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:90:16
10 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
11 verbose cwd /home/singhanurag9080/Downloads/material-react/material-kit-react-master
12 verbose Linux 5.0.0-25-generic
13 verbose argv "/home/singhanurag9080/.nvm/versions/node/v10.16.3/bin/node" "/home/singhanurag9080/.nvm/versions/node/v10.16.3/bin/npm" "install" "-g"
14 verbose node v10.16.3
15 verbose npm v6.9.0
16 error Unexpected token { in JSON at position 27
17 verbose exit [ 1, true ]
它认为package.json文件中有一个无效字符。你要是把文件寄出去就更好了。
问题内容: 我有一个有效的node_modules文件夹,并且尝试了package.json的许多排列,它们应该创建相同的结果并创建极其接近的结果,但是我的项目无法构建。我不知道如何解决这个问题。 我使用和手动添加了匹配的版本,并使用winMerge尝试查找差异。 我现有的node_modules文件夹可以工作,但是如果我重建它,它会失败。我机智的结束了。 编辑 并 问题答案: 您可以尝试使用sh
每个VS Code扩展需要一个清单文件package.json,该文件位于扩展的根目录中。 字段 名称 是否必要 类型 说明 name 是 string 扩展的名称,该名称必须为小写且不能有空格。 version 是 string SemVer 兼容版本. publisher 是 string 发布人名字 engines 是 object 一个至少包含vscode键值对的对象,该键表示的是本扩展可
问题内容: 假设我安装了项目包,其中包含要安装的模块。一段时间后,我发现我不需要某些特定的模块,并从中删除了对它的依赖。然后,我从中删除了一些其他模块,因为不再需要它们,而其他模块则被替换。 现在,我要清理文件夹,以便只有其中列出的模块可以呆在那里,其余的必须进入,如。我知道我可以手动将其删除,但希望为此可以使用糖功能。 问题答案: 我想你在找 此命令删除“外部”软件包。如果提供了软件包名称,则仅
我是一个长期LAMP开发人员,并且习惯在需要时使用autoloader加载类,但直到那时才开始,但现在正在学习Node.js。许多示例显示了加载所有文件的文件夹中的index.js文件。 例如:模型 在我的代码中,我使用 这是首选方法吗? 如果是,为什么? 为什么不使用自动装载机,只在需要的时候加载文件呢? 我在网上搜索,但没有找到任何明确解释这一点的东西。如果你有一篇文章对你有帮助,我将不胜感激
我在intellij上制作了一个minecraft mod(Eclipse对我不起作用),它找不到我正在制作的项目的任何json文件或纹理,有人告诉我在gradle中添加一行代码,然后它就修复了。但是现在它找不到我现在添加的块的纹理。这是我遵循的教程。https://www.youtube.com/watch?v=42z8_UDLmk4 如果有人知道原因,请告诉我。