对Visual Studio代码中的导入错误做出反应,它会自动添加长路径

时间:2018-08-03 02:25:29

标签: node.js reactjs visual-studio-code

react import  error in visual studio code

react Failed to compile

import React, { Component } from 'react'
import PropTypes from 'C:/Users/appsmaster/AppData/Local/Microsoft/TypeScript/2.9/node_modules/@types/prop-types'

错误:

  

./ src / components / footer / index.js   找不到模块:

中无法解析“ C:/Users/appsmaster/AppData/Local/Microsoft/TypeScript/2.9/node_modules/@types/prop-types”

1 个答案:

答案 0 :(得分:0)

尝试安装/重新安装 npm install --save prop-types 并检查错误是否持续