【问题记录】解决npm 报错This dependency was not found: A complete log of this run can be found in:

输入npm run serve报错,输入npm install --save vue-cropper,也无法安装,如下:
【问题记录】解决npm 报错This dependency was not found: A complete log of this run can be found in:_第1张图片
【问题记录】解决npm 报错This dependency was not found: A complete log of this run can be found in:_第2张图片

【问题记录】解决npm 报错This dependency was not found: A complete log of this run can be found in:_第3张图片
修改了:
webpack.config.js,找到module

如果只是 { test:/.js$/ , use:“babel-loader” }添加上 exclude:/node_modules/

改成:{ test:/.js$/ , use:“babel-loader”,exclude:/node_modules/ }
这样改了之后再run serve仍然报错。然后:
然后输入了:
npm install npm@latest -g
npm cache clean --force
npm i npm -g
npm install --save vue-cropper,此时再安装已经安装成功了。

npm run serve

【问题记录】解决npm 报错This dependency was not found: A complete log of this run can be found in:_第4张图片
在端口启动了但是有报警。原因可能跟main.js里面导入了什么有关
现在的main.js:


import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
//import Video from 'video.js'
import 'video.js/dist/video-js.css'
//Vue.prototype.$video = Video
// 导入iconfront
import './assets/font/iconfont.css'
import 'element-ui/lib/theme-chalk/index.css';
//import SvgIcon from 'vue-svgicon'
import VideoPlayer from 'vue-video-player'
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
require('./styles/video.css')
Vue.use(VideoPlayer)

// 导入axios
import axios from 'axios'
import * as echarts from 'echarts'
import VueCookies from 'vue-cookies'
import FullCalendar from 'vue-fullcalendar'
import 'default-passive-events'
import VueRouter from 'vue-router'

Vue.use(FullCalendar)
// import axios from "axios";
Vue.prototype.$axios = axios
Vue.use(VueCookies)
// require('./assets/bootstrap-3.3.7-dist/css/bootstrap.min.css');
// import './assets/bootstrap-3.3.7-dist/css/bootstrap.min.css'
// import './assets/bootstrap-3.3.7-dist/js/bootstrap.min.js'
Vue.prototype.$echarts = echarts

// 挂载axios 到Vue的原型prototype的$http
Vue.prototype.$http = axios
// 设置请求的根路径
axios.defaults.baseURL = "http://localhost:9000/"
axios.interceptors.request.use(config => {
  console.log(config);
  // 请求头挂载信息
  config.headers.Authorization = window.sessionStorage.getItem("flag");
  // 在最后必须return config
  return config;
})
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')

下一个问题是:
【问题记录】解决npm 报错This dependency was not found: A complete log of this run can be found in:_第5张图片
video-player播放器的异常。

你可能感兴趣的:(vue,npm)