首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有办法在node_modules文件夹下安装Semantic-UI?

有没有办法在node_modules文件夹下安装Semantic-UI?
EN

Stack Overflow用户
提问于 2018-02-22 04:45:03
回答 1查看 519关注 0票数 0

我刚刚注意到有一个新版本的Semantic-UI,并立即想要升级。现在,2.2.x之前的所有小升级在npm update上都工作得很好,但是跳转到2.3停止了工作,刷新了所有以前的构建,并强制从开始重新启动所有东西(选择项目等)。我的项目根本不是npm项目,只是有MVC逻辑,并且想要编译我自己的css包来在我的视图中使用。我重用了包中的分布式js。有什么建议吗?如何在node_modules文件夹中加入所有默认发行版的semantic-ui项目?

下面是我通常得到的信息:

代码语言:javascript
复制
Installing
------------------------------
Installing to node_modules/semantic-ui
Copying UI definitions
[20:07:55] 'create install files' errored after 8 ms
[20:07:55] Error: ENOENT: no such file or directory, stat './src/definitions'
    at Object.fs.statSync (fs.js:968:11)
    at Object.exports.copyDirSyncRecursive (/path/to/project/node_modules/wrench-sui/lib/wrench.js:244:23)
    at Gulp.<anonymous> (/path/to/project/node_modules/semantic-ui/tasks/install.js:302:12)
    at module.exports (/path/to/project/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/path/to/project/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/path/to/project/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/path/to/project/node_modules/orchestrator/index.js:134:8)
    at runNextSet (/path/to/project/node_modules/run-sequence/index.js:106:15)
    at Gulp.onTaskEnd (/path/to/project/node_modules/run-sequence/index.js:95:4)
    at Gulp.emit (events.js:165:20)
[20:07:55] 'install' errored after 14 s
[20:07:55] Error in plugin 'run-sequence(create install files)'
Message:
    ENOENT: no such file or directory, stat './src/definitions'
Details:
    errno: -2
    code: ENOENT
    syscall: stat
    path: ./src/definitions
EN

回答 1

Stack Overflow用户

发布于 2018-02-22 04:45:03

当我完成我的问题草稿并开始复习时,立即想到了一个测试用例:为什么不尝试完整路径。这招奏效了。我不想让这段经历浪费掉,也不想在这里分享我的挣扎和浪费时间。

代码语言:javascript
复制
Installing
------------------------------
Installing to /path/to/project/node_modules/semantic-ui
Copying UI definitions
Copying UI themes
Copying gulp tasks
Adding theme files
Creating gulpfile.js
Creating site theme folder /path/to/project/path/to/project/node_modules/semantic-ui/src/site/
[20:22:36] Starting 'create theme.config'...
Adjusting @siteFolder to:  site/
Creating src/theme.config (LESS config) /path/to/project/path/to/project/node_modules/semantic-ui/src/theme.config
[20:22:36] Finished 'create theme.config' after 13 ms
[20:22:36] Starting 'create semantic.json'...
Creating config file (semantic.json) /path/to/project/semantic.json
[20:22:36] Finished 'create semantic.json' after 10 ms
[20:22:36] Finished 'create install files' after 103 ms
[20:22:36] Starting 'clean up install'...

 Setup Complete! 
 Installing Peer Dependencies. Please refrain from ctrl + c... 
 After completion navigate to /path/to/project/node_modules/semantic-ui and run "gulp build" to build
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ semantic-ui@2.3.0
added 22 packages in 55.506s

注意!脚本会自动在path/to/project中为你安装网页,这看起来像是双重复制,但事实并非如此。Had只需将其从源代码中删除,并检查theme.config中的任何更改。其他脚本已经准备就绪,可以继续运行了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48915118

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档