我刚开始为Angular2开设Udemy课程。讲师包括一个种子项目开始。我正在尝试运行“npm install”来安装package.json中的所有模块。运行安装后,永远不会安装“node_modules”文件夹。
以下是我采取的步骤。 1.将code.zip文件和解压缩的文件下载到文件夹中。 2.在Visual Studio中创建了一个新的“Empty Web”项目。 3.将文件复制到项目中。 4.打开命令提示符,转到package.json所在的文件夹,运行“npm install”
当我查看文件夹结构时,没有创建node_modules文件夹。
然后我查看了npm-debug.log,我看到一堆关于“证书已过期”的错误。然后我最终看到它运行“rollbackFailedOptional”的位置。这是一些日志文件。
155 silly fetchPackageMetaData at Error (native)
155 silly fetchPackageMetaData at TLSSocket.<anonymous> (_tls_wrap.js:1079:38)
155 silly fetchPackageMetaData at emitNone (events.js:86:13)
155 silly fetchPackageMetaData at TLSSocket.emit (events.js:185:7)
155 silly fetchPackageMetaData at TLSSocket._finishInit (_tls_wrap.js:603:8)
155 silly fetchPackageMetaData at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
155 silly fetchPackageMetaData error for rxjs@5.0.0-beta.2 { Error: certificate has expired
155 silly fetchPackageMetaData at Error (native)
155 silly fetchPackageMetaData at TLSSocket.<anonymous> (_tls_wrap.js:1079:38)
155 silly fetchPackageMetaData at emitNone (events.js:86:13)
155 silly fetchPackageMetaData at TLSSocket.emit (events.js:185:7)
155 silly fetchPackageMetaData at TLSSocket._finishInit (_tls_wrap.js:603:8)
155 silly fetchPackageMetaData at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38) code: 'CERT_HAS_EXPIRED' }
156 silly rollbackFailedOptional Starting
157 silly rollbackFailedOptional Finishing
158 silly runTopLevelLifecycles Finishing
159 silly install printInstalled
160 verbose stack Error: certificate has expired
160 verbose stack at Error (native)
160 verbose stack at TLSSocket.<anonymous> (_tls_wrap.js:1079:38)
160 verbose stack at emitNone (events.js:86:13)
160 verbose stack at TLSSocket.emit (events.js:185:7)
160 verbose stack at TLSSocket._finishInit (_tls_wrap.js:603:8)
160 verbose stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
161 verbose cwd C:\DevExampleProjects\Angular2-Seed-Udemy\Angular2-Seed-Udemy
162 error Windows_NT 6.1.7601
163 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
164 error node v6.9.2
165 error npm v3.10.9
166 error code CERT_HAS_EXPIRED