我做了npm install socket.io-client
。 我然後將它導入如下圖所示需要未知模塊「socket.io-client/socket.io」
import React from 'react-native';
import './UserAgent';
import io from 'socket.io-client/socket.io';
但是當我運行我的應用程序,我得到以下錯誤:
Requiring uknown module "socket.io-client/socket.io". If you are sure this module is there, try restarting the packager.
我試着重新安裝和更新NPM。
我重新啓動了包裝器1000次。
任何想法爲什麼會發生這種情況?
是的,我也試過。 'socket.io-client'和'socket.io'都會拋出同樣的錯誤... –