首页 > 解决方案 > 我在安装 npm 时遇到问题,并且损坏了所有内容

问题描述

再次向整个社区问好,我在多次删除 package.json 和 node_modules 后尝试在我的项目中重新安装 npm,但它对我没有任何作用。当我npm install从字面上什么都没有发生时,但是当我这样做npm run dev时会引发以下错误:

tom@tom-CR62-7ML:/var/www/html/Proyectos/clinic$ npm run dev

> @ dev /var/www/html/Proyectos/clinic
> npm run development


> @ development /var/www/html/Proyectos/clinic
> mix

sh: 1: mix: not found

npm ERR! Linux 4.15.0-135-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "development"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: `mix`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the @ development script 'mix'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mix
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/html/Proyectos/clinic/npm-debug.log

npm ERR! Linux 4.15.0-135-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/html/Proyectos/clinic/npm-debug.log

如果任何专家可以在这个问题上帮助我,我将不胜感激,因为我已经处理了几个小时。谢谢!

我添加我的 package.json 文件

{
  "name": "clinic",
  "version": "1.0.0",
  "description": "<p align=\"center\"><a href=\"https://laravel.com\" target=\"_blank\"><img src=\"https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg\" width=\"400\"></a></p>",
  "main": "webpack.mix.js",
  "directories": {
    "test": "tests"
  },
  "scripts": {
    "test": "dev"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Code1995Tom/clinic.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/Code1995Tom/clinic/issues"
  },
  "homepage": "https://github.com/Code1995Tom/clinic#readme"
}

标签: node.jslaravelnpm

解决方案


推荐阅读