fis3-hook-relative icon indicating copy to clipboard operation
fis3-hook-relative copied to clipboard

安装成功使用报错

Open MinosIE opened this issue 9 years ago • 10 comments

运行如下命令安装: npm install -g fis3-hook-relative 控制台显示: [email protected] C:\User\user\AppData\Roaming\npm\node_modules\fis3-hook-relative 应该是安装成功了吧 fis配置文件: // 启用插件 fis.hook('relative'); // 让所有文件,都使用相对路径。 fis.match('**', { relative: true }) fis命令: fis3 release -d ../dist 控制台报错: [ERROR] unable to load plugin [fis3-hook-relative] or [fis-hook-relative] 请问是什么原因导致的!

MinosIE avatar Dec 29 '15 06:12 MinosIE

设置 NODE_PATH 环境变量,值为 C:\User\user\AppData\Roaming\npm\node_modules

oxUnd avatar Dec 29 '15 06:12 oxUnd

@xiangshouding 我在环境变量里面配置了 还是相同的错误

MinosIE avatar Dec 30 '15 06:12 MinosIE

 Cannot read property 'dirname' of undefined in [/app/city.html]

请问这是什么原因?

Jmingzi avatar Mar 01 '16 07:03 Jmingzi

@xiangshouding @2betop 我在使用fis3-hook-relative插件也遇到 @JMingZI 一样的问题,我的项目在本地打相对路径的包时也是报:[ERROR] Cannot read property 'dirname' of undefined。但在开发fis3 release -w 和 打绝对路径的包fis release production都没问题。 求解决方案~~

luozt avatar May 14 '16 12:05 luozt

有能复现的项目吗?提供一个的话我能很快修复。

2betop avatar May 16 '16 02:05 2betop

@2betop 可以看我的这个项目:react admin ctrl,我现在只能用绝对路径打包,用hook(relative)就报错。。

luozt avatar May 16 '16 02:05 luozt

升级 fis3-hook-node_modules 吧,问题应该解决了。

2betop avatar May 16 '16 02:05 2betop

的确是可以了!貌似我促进了fis的发展,哈哈。虽然说官方推荐用绝对路径,但用相对路径打包,对于同一份代码需要在不同环境运行的这种情况还是比较方便的

luozt avatar May 16 '16 05:05 luozt

+1

Jmingzi avatar Jul 12 '16 07:07 Jmingzi

直接放在自己当前目录安装就可以了,不安装到全局就可以使用

lijicheng123 avatar Apr 26 '17 10:04 lijicheng123