我正在尝试在本地机器上运行 React 应用程序,运行时出现此错误
npm run start:
> node scripts/start.js
internal/validators.js:125
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Object.resolve (path.js:161:7)
at resolveApp (D:\Projects\react-app\react-site-master\config\paths.js:10:41)
at Object.<anonymous> (D:\Projects\react-app\react-site-master\config\paths.js:73:13)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! glc2@0.1.5 start: `node scripts/start.js`
npm ERR! Exit status 1
Run Code Online (Sandbox Code Playgroud)
我尝试执行以下操作,但结果相同: …
我有一个带有一些链接的页脚组件,每个链接都指向页面的特定部分,如何使链接跳转到该特定部分而不是仅路由到该页面。
<li><Link to="/about-us/#section1">Our History</Link></li>
<li><Link to="/about-us/#section2">Our Mission</Link></li>
<li><Link to="/about-us/#section3">Our Values</Link></li>
<li><Link to="/about-us/#section4">Become a Distributor</Link></li>
我已尝试在目标部分中使用相同标记的先前代码id,但它不起作用。还有其他方法可以做到这一点吗?
谢谢,